Skip to content
This repository has been archived by the owner on Aug 17, 2022. It is now read-only.

Commit

Permalink
Feature/wdl support (#5)
Browse files Browse the repository at this point in the history
* working wdl descriptor

* better use of input GB

* added to travis and updated readme
  • Loading branch information
agduncan94 authored Aug 31, 2018
1 parent 76b351b commit 14b9de5
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 6 deletions.
10 changes: 7 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ sudo: required
services:
- docker

env:
- LANGUAGE=cwl
- LANGUAGE=wdl

notifications:
slack:
on_success: never
Expand All @@ -16,10 +20,10 @@ jdk:

before_install:
- docker build -t quay.io/collaboratory/dockstore-tool-bamstats .
- pip2.7 install --user setuptools==24.0.3
- bash before-install.sh

install:
- pip2.7 install --user cwl-runner cwltool==1.0.20160712154127 schema-salad==1.14.20160708181155 avro==1.8.1
- bash install.sh

script:
- cwltool --non-strict Dockstore.cwl test.json
- bash script.sh
27 changes: 27 additions & 0 deletions Dockstore.wdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
task bamstats {
File bam_input
Int mem_gb

command {
bash /usr/local/bin/bamstats ${mem_gb} ${bam_input}
}

output {
File bamstats_report = "bamstats_report.zip"
}

runtime {
docker: "quay.io/collaboratory/dockstore-tool-bamstats:1.25-6_1.0"
memory: mem_gb + "GB"
}

meta {
author: "Andrew Duncan"
}
}

workflow bamstatsWorkflow {
File bam_input
Int mem_gb
call bamstats { input: bam_input=bam_input, mem_gb=mem_gb }
}
34 changes: 31 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ You'll then see a file, `bamstats_report.zip`, in the current directory, that's
## Running Through the Dockstore CLI

This tool can be found at the [Dockstore](https://dockstore.org), login with your GitHub account and follow the
directions to setup the CLI. It lets you run a Docker container with a CWL descriptor locally, using Docker and the CWL command line utility. This is great for testing.
directions to setup the CLI. It lets you run a Docker container with a CWL/WDL descriptor locally, using Docker and the CWL/WDL command line utility. This is great for testing.

### Make a Parameters JSON
### With CWL

#### Make a Parameters JSON

This is the parameterization of the BAM stat tool, a copy is present in this repo called `sample_configs.json`:

Expand All @@ -62,7 +64,7 @@ This is the parameterization of the BAM stat tool, a copy is present in this rep
}
```

### Run with the CLI
#### Run with the CLI

Run it using the `dockstore` CLI:

Expand All @@ -75,3 +77,29 @@ $> dockstore tool convert cwl2json --cwl Dockstore.cwl > Dockstore.json
# run it locally with the Dockstore CLI
$> dockstore tool launch --entry quay.io/collaboratory/dockstore-tool-bamstats:1.25-3 --json Dockstore.json
```

### With WDL
#### Make a Parameters JSON

This is the parameterization of the BAM stat tool, a copy is present in this repo called `test.wdl.json`:

```
{
"bamstatsWorkflow.bam_input": "rna.SRR948778.bam",
"bamstatsWorkflow.mem_gb": "4"
}
```

#### Run with the CLI

Run it using the `dockstore` CLI:

```
Usage:
# fetch WDL
$> dockstore tool wdl --entry quay.io/collaboratory/dockstore-tool-bamstats > Dockstore.wdl
# make a runtime JSON template and edit it (or use the content of test.wdl.json above)
$> dockstore tool convert wdl2json --wdl Dockstore.wdl > Dockstore.json
# run it locally with the Dockstore CLI
$> dockstore tool launch --entry quay.io/collaboratory/dockstore-tool-bamstats --json Dockstore.json
```
10 changes: 10 additions & 0 deletions before-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

set -o errexit
set -o pipefail
set -o nounset
set -o xtrace

if [[ "${LANGUAGE}" == "cwl" ]]; then
pip2.7 install --user setuptools==24.0.3
fi
12 changes: 12 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

set -o errexit
set -o pipefail
set -o nounset
set -o xtrace

if [[ "${LANGUAGE}" == "cwl" ]]; then
pip2.7 install --user cwl-runner cwltool==1.0.20160712154127 schema-salad==1.14.20160708181155 avro==1.8.1
elif [[ "${LANGUAGE}" == "wdl" ]]; then
wget https://github.com/broadinstitute/cromwell/releases/download/32/cromwell-32.jar
fi
12 changes: 12 additions & 0 deletions script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

set -o errexit
set -o pipefail
set -o nounset
set -o xtrace

if [[ "${LANGUAGE}" == "cwl" ]]; then
cwltool --non-strict Dockstore.cwl test.json
elif [[ "${LANGUAGE}" == "wdl" ]]; then
java -jar cromwell-32.jar run Dockstore.wdl --inputs test.wdl.json
fi
4 changes: 4 additions & 0 deletions test.wdl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"bamstatsWorkflow.bam_input": "rna.SRR948778.bam",
"bamstatsWorkflow.mem_gb": "4"
}

0 comments on commit 14b9de5

Please sign in to comment.