Skip to content

Commit

Permalink
Feature/update (#6)
Browse files Browse the repository at this point in the history
* replace Docker image
* Create workflows.yml
* Update README.md
* get rid of .travis.yml
  • Loading branch information
denis-yuen authored Aug 16, 2022
1 parent b1eea79 commit 82afe11
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 71 deletions.
29 changes: 29 additions & 0 deletions .dockstore.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: 1.2
tools:
- subclass: CWL
primaryDescriptorPath: /bamstats.cwl
testParameterFiles:
- /test.json
name: bamstats_cwl
authors:
- orcid: 0000-0002-6130-1021
- subclass: CWL
primaryDescriptorPath: /bamstats_sort.cwl
testParameterFiles:
- /test.json
name: bamstats_sort_cwl
authors:
- orcid: 0000-0002-6130-1021
workflows:
- subclass: WDL
primaryDescriptorPath: /bamstats.wdl
testParameterFiles:
- /test.wdl.json
name: wdl
authors:
- orcid: 0000-0002-6130-1021
- subclass: NFL
primaryDescriptorPath: /nextflow.config
name: nfl
authors:
- orcid: 0000-0002-6130-1021
33 changes: 33 additions & 0 deletions .github/workflows/workflows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Test workflows

on: [push]

jobs:
example_matrix:
strategy:
fail-fast: false
matrix:
lang: [cwl, wdl, nfl]

env:
LANGUAGE: ${{ matrix.lang }}

runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
- name: Build Docker image
uses: docker/build-push-action@v3
with:
push: false
tags: quay.io/collaboratory/dockstore-tool-bamstats

- if: matrix.lang == 'cwl'
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Setup engines
run: bash install.sh
- name: Run workflows
run: bash script.sh
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

32 changes: 10 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[![Docker Repository on Quay.io](https://quay.io/repository/collaboratory/dockstore-tool-bamstats/status "Docker Repository on Quay.io")](https://quay.io/repository/collaboratory/dockstore-tool-bamstats)
[![Build Status](https://travis-ci.org/CancerCollaboratory/dockstore-tool-bamstats.svg)](https://travis-ci.org/CancerCollaboratory/dockstore-tool-bamstats)

# dockstore-tool-bamstats

A repo for the `Dockerfile` to create a Docker image for the BAMStats command. Also contains the
Expand All @@ -11,29 +8,20 @@ this container and describe how to call BAMStats for the community.

This tool has been validated as a CWL draft-3 and v1.0 CommandLineTool.

Versions that we tested with are the following
```
avro (1.8.1)
cwl-runner (1.0)
cwl-upgrader (0.1.1)
cwltool (1.0.20190915164430)
schema-salad (4.5.20190906201758)
setuptools (25.1.6)
```
Versions that we tested with are documented iin https://raw.githubusercontent.com/dockstore/dockstore/1.13.0-beta.3/dockstore-webservice/src/main/resources/requirements/1.13.0/requirements3.txt


## Building Manually

Normally you would let [Quay.io](http://quay.io) build this. But, if you need to build
manually you would execute:
Normally you would let GitHub actions build this. But, if you need to build manually (for example due to https://github.com/broadinstitute/cromwell/issues/6827) you would execute:

docker build -t collaboratory/dockstore-tool-bamstats:1.25-7 .
docker build -t ghcr.io/dockstore/dockstore-tool-bamstats:1.25-8 .

## Running Manually

```
$ wget ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/phase3/data/NA12878/alignment/NA12878.chrom20.ILLUMINA.bwa.CEU.low_coverage.20121211.bam
$ docker run -it -v `pwd`/NA12878.chrom20.ILLUMINA.bwa.CEU.low_coverage.20121211.bam:/NA12878.chrom20.ILLUMINA.bwa.CEU.low_coverage.20121211.bam collaboratory/dockstore-tool-bamstats:1.25-7
$ docker run -it -v `pwd`/NA12878.chrom20.ILLUMINA.bwa.CEU.low_coverage.20121211.bam:/NA12878.chrom20.ILLUMINA.bwa.CEU.low_coverage.20121211.bam ghcr.io/dockstore/dockstore-tool-bamstats:1.25-8
# within the docker container
$ /usr/local/bin/bamstats 4 /NA12878.chrom20.ILLUMINA.bwa.CEU.low_coverage.20121211.bam
Expand Down Expand Up @@ -70,16 +58,16 @@ Run it using the `dockstore` CLI:

```
# Fetch CWL workflow
dockstore tool cwl --entry quay.io/collaboratory/dockstore-tool-bamstats:1.25-7 > Dockstore.cwl
dockstore workflow cwl --entry github.com/dockstore/dockstore-tool-bamstats/bamstats_cwl:feature/update > bamstats.cwl
# Make a runtime JSON template and edit it (or use the content of sample_configs.json above)
dockstore tool convert cwl2json --cwl Dockstore.cwl > Dockstore.json
dockstore workflow convert cwl2json --cwl bamstats.cwl > Dockstore.json
# Update the "path" field for both input and output files within Dockstore.json
jq '.bam_input.path |= "ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/phase3/data/NA12878/alignment/NA12878.chrom20.ILLUMINA.bwa.CEU.low_coverage.20121211.bam"| .bamstats_report.path |= "/tmp/bamstats_report.zip"' Dockstore.json | sponge Dockstore.json
# Run it locally with the Dockstore CLI
dockstore tool launch --entry quay.io/collaboratory/dockstore-tool-bamstats:1.25-7 --json Dockstore.json
dockstore workflow launch --entry github.com/dockstore/dockstore-tool-bamstats/bamstats_cwl:feature/update --json Dockstore.json
```

### With WDL
Expand All @@ -101,11 +89,11 @@ Run it using the `dockstore` CLI:
```
Usage:
# fetch WDL
$> dockstore tool wdl --entry quay.io/collaboratory/dockstore-tool-bamstats > Dockstore.wdl
$> dockstore workflow wdl --entry github.com/dockstore/dockstore-tool-bamstats/wdl:feature/update > bamstats.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
$> dockstore workflow convert wdl2json --wdl bamstats.wdl > Dockstore.json
# run it locally with the Dockstore CLI
$> dockstore tool launch --entry quay.io/collaboratory/dockstore-tool-bamstats --json Dockstore.json
$> dockstore workflow launch --entry github.com/dockstore/dockstore-tool-bamstats/wdl:feature/update --json Dockstore.json
```

## Running Nextflow Workflow
Expand Down
2 changes: 1 addition & 1 deletion Dockstore.cwl → bamstats.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dct:creator:
requirements:
- class: DockerRequirement
dockerPull: "quay.io/collaboratory/dockstore-tool-bamstats:1.25-7"
dockerPull: "ghcr.io/dockstore/dockstore-tool-bamstats:1.25-8"
hints:
- class: ResourceRequirement
Expand Down
2 changes: 1 addition & 1 deletion Dockstore.wdl → bamstats.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ task bamstats {
}

runtime {
docker: "quay.io/collaboratory/dockstore-tool-bamstats:1.25-7"
docker: "ghcr.io/dockstore/dockstore-tool-bamstats:1.25-8"
memory: mem_gb + "GB"
}

Expand Down
2 changes: 1 addition & 1 deletion Dockstore2.cwl → bamstats_sort.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dct:creator:
requirements:
- class: DockerRequirement
dockerPull: "quay.io/collaboratory/dockstore-tool-bamstats:1.25-7"
dockerPull: "ghcr.io/dockstore/dockstore-tool-bamstats:1.25-8"
inputs:
input:
Expand Down
10 changes: 0 additions & 10 deletions before-install.sh

This file was deleted.

4 changes: 2 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ set -o nounset
set -o xtrace

if [[ "${LANGUAGE}" == "cwl" ]]; then
curl -o requirements.txt "https://raw.githubusercontent.com/dockstore/dockstore/1.7.0-rc.3/dockstore-webservice/src/main/resources/requirements/1.7.0/requirements3.txt"
curl -o requirements.txt "https://raw.githubusercontent.com/dockstore/dockstore/1.13.0-beta.3/dockstore-webservice/src/main/resources/requirements/1.13.0/requirements3.txt"
pip3 install --user -r requirements.txt
elif [[ "${LANGUAGE}" == "wdl" ]]; then
wget https://github.com/broadinstitute/cromwell/releases/download/44/cromwell-44.jar
elif [[ "${LANGUAGE}" == "nfl" ]]; then
curl -s https://get.nextflow.io | bash
mv nextflow $HOME/bin
cp nextflow $HOME/bin
fi
2 changes: 1 addition & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ params {
mem_gb = '4'
}

process.container = 'quay.io/collaboratory/dockstore-tool-bamstats:1.25-7'
process.container = 'ghcr.io/dockstore/dockstore-tool-bamstats:1.25-8'
docker {
enabled = true
docker.runOptions = '-u $(id -u):$(id -g)'
Expand Down
6 changes: 3 additions & 3 deletions script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ set -o nounset
set -o xtrace

if [[ "${LANGUAGE}" == "cwl" ]]; then
cwltool --non-strict Dockstore.cwl test.json
cwltool --non-strict bamstats.cwl test.json
elif [[ "${LANGUAGE}" == "wdl" ]]; then
java -jar cromwell-44.jar run Dockstore.wdl --inputs test.wdl.json
java -jar cromwell-44.jar run bamstats.wdl --inputs test.wdl.json
elif [[ "${LANGUAGE}" == "nfl" ]]; then
nextflow run main.nf
./nextflow run main.nf
fi

0 comments on commit 82afe11

Please sign in to comment.