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

Commit

Permalink
Feature/nextflow support (#6)
Browse files Browse the repository at this point in the history
* basic nextflow workflow

* Updated travis and readme
  • Loading branch information
agduncan94 authored Aug 31, 2018
1 parent 14b9de5 commit b12811b
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 1 deletion.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ services:
env:
- LANGUAGE=cwl
- LANGUAGE=wdl
- LANGUAGE=nfl

notifications:
slack:
Expand Down
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,13 @@ $> dockstore tool wdl --entry quay.io/collaboratory/dockstore-tool-bamstats > Do
$> 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
```
```

## Running Nextflow Workflow

Install [Nextflow](https://www.nextflow.io/). Nextflow workflows cannot be run with the Dockstore CLI yet.

The workflow can be run using the following command:
```
$> nextflow run main.nf
```
3 changes: 3 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ 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
elif [[ "${LANGUAGE}" == "nfl" ]]; then
curl -s https://get.nextflow.io | bash
mv nextflow $HOME/bin
fi
16 changes: 16 additions & 0 deletions main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env nextflow

bamFile = file(params.bam_input)

process bamstats {
input:
file bam_input from bamFile
val mem_gb from params.mem_gb

output:
file 'bamstats_report.zip'

"""
bash /usr/local/bin/bamstats $mem_gb $bam_input
"""
}
15 changes: 15 additions & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
manifest {
description = 'Generate some stats on a BAM file'
author = 'Andrew Duncan'
}

params {
bam_input = 'rna.SRR948778.bam'
mem_gb = '4'
}

process.container = 'quay.io/collaboratory/dockstore-tool-bamstats:1.25-6_1.0'
docker {
enabled = true
docker.runOptions = '-u $(id -u):$(id -g)'
}
2 changes: 2 additions & 0 deletions script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ 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
elif [[ "${LANGUAGE}" == "nfl" ]]; then
nextflow run main.nf
fi

0 comments on commit b12811b

Please sign in to comment.