Skip to main content

SBG Python library to create CWL tools and workflows

Project description

SevenBridges CWL

Table of contents

  1. Overview
  2. Install
  3. Docs
  4. Run tests
  5. Examples

Overview

SevenBridges CWL package provides python bindings for Common Workflow Language. It is intended for developers who want to use python code to generate CWL documents. If creating a document through the GUI is preferable, then look at the Rabix Composer.

Install

Official releases

Official releases are available via pip install sevenbridges-cwl (This is the pypi entry for this project)

Development versions

To obtain unreleased versions:

  • git clone this repository
  • cd sevenbridges-cwl && pip install .

The master branch is for more stable code while develop is for cutting edge features being currently worked on

Docs

Complete documentation can be found here.

If you are interested in reviewing this documentation locally, clone this repository, position yourself in the docs directory and after installing requirements-dev.txt, invoke:

make html

Run Tests

In order to run tests clone this repository, position yourself in the root of the cloned project and, after installing requirements-dev.txt, invoke:

pytest

Examples

The following code will give a brief overview of what this package can offer through simple examples.

A Complete list of all examples can be found here.

Run workflow on a SevenBridges platform

from sbg import cwl


# First node
@cwl.to_tool(
    inputs=dict(x=cwl.String()),
    outputs=dict(out=cwl.Float(required=True)),
    docker='images.sbgenomics.com/filip_tubic/ubuntu1604py'
)
def to_float(x):
    return dict(out=float(x))


# Second node
@cwl.to_tool(
    inputs=dict(x=cwl.Float(), n=cwl.Int()),
    outputs=dict(out=cwl.Float()),
    docker='images.sbgenomics.com/filip_tubic/ubuntu1604py'
)
def times_n(x, n=10):
    return dict(out=x * n)


wf = cwl.Workflow()

# create tools
t1 = to_float()
t2 = times_n()

# steps
wf.add_step(t1, expose=['x'])
wf.add_step(t2, expose=['n', 'out'])

# add connections
wf.add_connection(f'{t1.id}.out', f'{t2.id}.x')

# Session on a SBG platform
session = cwl.Session(profile='<your_profile>')

session.run('<your_project>', wf, inputs={'x': '10.2'})

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

sevenbridges-cwl-1.1.4.tar.gz (66.7 kB view details)

Uploaded Source

File details

Details for the file sevenbridges-cwl-1.1.4.tar.gz.

File metadata

  • Download URL: sevenbridges-cwl-1.1.4.tar.gz
  • Upload date:
  • Size: 66.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.1

File hashes

Hashes for sevenbridges-cwl-1.1.4.tar.gz
Algorithm Hash digest
SHA256 cdd8c61198f76d61b37c168c672530a57c1891b6994eccaf95df137262f114b4
MD5 acf8fd8bbea244b684ee2b8990d4ebac
BLAKE2b-256 0cff7cd556a1bcf13fc1bc93d23c315bafd46ab33947fd295b7eb73eb3ff8070

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