Skip to content

BioBam/wdk-lib

Repository files navigation

Workflow Development Kit (wdk)

An open-source framework for defining Common Workflow Language (CWL) workflows using TypeScript and Java. wdk uses a construct-tree model inspired by the AWS CDK to let you define workflows as code, then synthesize them into standard CWL files that run on any compliant engine.

Quick Example

import { App, Workflow, Tool, ToolConfig, Input } from 'wdk-lib';

class Echo extends Tool {
  constructor(scope: Workflow) {
    super(scope, 'echo');
    ToolConfig.basic(this).withBaseCommand(['echo']);
    Input.string(this, 'message').withPosition(1);
  }
}

const app = new App();
const workflow = new Workflow(app, 'hello-wdk');
new Echo(workflow);
app.synth();

This produces a CWL CommandLineTool file in dist/hello-wdk/, ready to run with any CWL engine:

cwltool dist/hello-wdk/echo.clt.cwl --message "Hello, WDK!"

Installation

TypeScript / JavaScript

npm install wdk-lib

Java (via JSII, published to GitHub Packages)

<dependency>
  <groupId>com.biobam</groupId>
  <artifactId>wdk-lib</artifactId>
</dependency>

Repository: https://maven.pkg.github.com/biobam/wdk-lib

Key Concepts

wdk models workflows as a tree of constructs:

  • App -- root of the tree, calls synth() to emit CWL files
  • Workflow -- a CWL Workflow containing steps
  • Tool -- a CWL CommandLineTool with typed inputs and outputs
  • Input / Output -- typed ports that connect steps together
  • Requirement -- Docker images, resource limits, environment variables

See Concepts for details and code examples.

Documentation

Additional guides in docs/:

Examples

The src/examples/ directory contains working examples:

  • CdHit workflow -- a multi-step pipeline with parameter generation, tool execution, and post-processing
  • Pathway analysis -- tools for loading sequences and running pathway analysis
  • EggNOG Mapper -- a workflow with Docker image configuration and database mounting
  • PickFirst pattern -- merging optional outputs using FirstOrNullExpressionTool

Contributing

See CONTRIBUTING.md for setup, issues, and pull requests.

License

Apache License, Version 2.0

About

An abstraction library aimed to make scientific workflow application writing and maintenance easier

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors