All Projects → NLeSC → scriptcwl

NLeSC / scriptcwl

Licence: Apache-2.0 license
Create cwl workflows by writing a simple Python script

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to scriptcwl

GGR-cwl
CWL tools and workflows for GGR
Stars: ✭ 20 (-50%)
Mutual labels:  cwl
janis
[Alpha] Janis: an open source tool to machine generate type-safe CWL and WDL workflows
Stars: ✭ 35 (-12.5%)
Mutual labels:  cwl
workflows
Bioinformatics workflows developed for and used on the St. Jude Cloud project.
Stars: ✭ 16 (-60%)
Mutual labels:  cwl
tool-registry-service-schemas
APIs for discovering genomics tools, their metadata and their containers
Stars: ✭ 27 (-32.5%)
Mutual labels:  cwl
dockstore
Our VM/Docker sharing infrastructure and management component
Stars: ✭ 99 (+147.5%)
Mutual labels:  cwl
wdl2cwl
[Experimental] Workflow Definition Language (WDL) to CWL
Stars: ✭ 26 (-35%)
Mutual labels:  cwl
cwlexec
A new open source tool to run CWL workflows on LSF
Stars: ✭ 34 (-15%)
Mutual labels:  cwl
user guide
The CWL v1.0 user guide
Stars: ✭ 20 (-50%)
Mutual labels:  cwl
reana
REANA: Reusable research data analysis platform
Stars: ✭ 86 (+115%)
Mutual labels:  cwl
benten
A language server for Common Workflow Language
Stars: ✭ 50 (+25%)
Mutual labels:  cwl
dxCompiler
WDL and CWL compiler for the DNAnexus platform
Stars: ✭ 15 (-62.5%)
Mutual labels:  cwl
tibanna
Tibanna helps you run your genomic pipelines on Amazon cloud (AWS). It is used by the 4DN DCIC (4D Nucleome Data Coordination and Integration Center) to process data. Tibanna supports CWL/WDL (w/ docker), Snakemake (w/ conda) and custom Docker/shell command.
Stars: ✭ 61 (+52.5%)
Mutual labels:  cwl
hotsub
Command line tool to run batch jobs concurrently with ETL framework on AWS or other cloud computing resources
Stars: ✭ 29 (-27.5%)
Mutual labels:  cwl
cwl-ts
Typescript data model for Common Workflow Language
Stars: ✭ 42 (+5%)
Mutual labels:  cwl
VIRTUS
A bioinformatics pipeline for viral transcriptome detection and quantification considering splicing.
Stars: ✭ 28 (-30%)
Mutual labels:  cwl
emg-viral-pipeline
VIRify: detection of phages and eukaryotic viruses from metagenomic and metatranscriptomic assemblies
Stars: ✭ 38 (-5%)
Mutual labels:  cwl
ipython2cwl
IPython2CWL is a tool for converting IPython Jupyter Notebooks to CWL Command Line Tools by simply providing typing annotation.
Stars: ✭ 15 (-62.5%)
Mutual labels:  cwl

scriptcwl

codacy_grade codacy_coverage travis documentation pypi_version pypi_supported DOI

scriptcwl is a Python package for creating workflows in Common Workflow Language (CWL). If you give it a number of CWL CommandLineTools, you can create a workflow by writing a Python script. This can be done interactively using Jupyter Notebooks. The full documentation can be found on Read the Docs.

add multiply example workflow

Given CWL CommandLineTools for add and multiply (these are available in scriptcwl), a CWL specification of this workflow can be written as:

from scriptcwl import WorkflowGenerator

with WorkflowGenerator() as wf:
  wf.load(steps_dir='/path_to_scriptcwl/scriptcwl/examples/')

  num1 = wf.add_input(num1='int')
  num2 = wf.add_input(num2='int')

  answer1 = wf.add(x=num1, y=num2)
  answer2 = wf.multiply(x=answer1, y=num2)

  wf.add_outputs(final_answer=answer2)

  wf.save('add_multiply_example_workflow.cwl')

The workflow has two integers as inputs (num1 and num2), and first adds these two numbers (wf.add(x=num1, y=num2)), and then multiplies the answer with the second input (num2). The result of that processing step is the output of the workflow. Finally, the workflow is saved to a file. The result looks like:

#!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: Workflow
inputs:
  num1: int
  num2: int
outputs:
  final_answer:
    type: int
    outputSource: multiply/answer
steps:
  add:
    run: add.cwl
    in:
      y: num2
      x: num1
    out:
    - answer
  multiply:
    run: multiply.cwl
    in:
      y: num2
      x: add/answer
    out:
    - answer

The Python and CWL files used in the example can be found in the examples folder.

Installation

Install using pip:

pip install scriptcwl

For development:

git clone [email protected]:NLeSC/scriptcwl.git
cd scriptcwl
python setup.py develop

Run tests (including coverage) with:

python setup.py test

Useful tools

To use scriptcwl for creating CWL workflows, you need CWL CommandLineTools. There are some software packages that help with generating those for existing command line tools written in Python:

  • argparse2tool: Generate CWL CommandLineTool wrappers (and/or Galaxy tool descriptions) from Python programs that use argparse. Also supports the click argument parser.
  • pypi2cwl: Automatically run argparse2cwl on any package in PyPi.
  • python-cwlgen: Generate CommandLineTool and DockerRequirement programmatically

License

Copyright (c) 2016-2018, Netherlands eScience Center, University of Twente

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].