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

Commit b12811b

Browse files
authored
Feature/nextflow support (#6)
* basic nextflow workflow * Updated travis and readme
1 parent 14b9de5 commit b12811b

File tree

6 files changed

+47
-1
lines changed

6 files changed

+47
-1
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ services:
66
env:
77
- LANGUAGE=cwl
88
- LANGUAGE=wdl
9+
- LANGUAGE=nfl
910

1011
notifications:
1112
slack:

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,13 @@ $> dockstore tool wdl --entry quay.io/collaboratory/dockstore-tool-bamstats > Do
102102
$> dockstore tool convert wdl2json --wdl Dockstore.wdl > Dockstore.json
103103
# run it locally with the Dockstore CLI
104104
$> dockstore tool launch --entry quay.io/collaboratory/dockstore-tool-bamstats --json Dockstore.json
105-
```
105+
```
106+
107+
## Running Nextflow Workflow
108+
109+
Install [Nextflow](https://www.nextflow.io/). Nextflow workflows cannot be run with the Dockstore CLI yet.
110+
111+
The workflow can be run using the following command:
112+
```
113+
$> nextflow run main.nf
114+
```

install.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@ if [[ "${LANGUAGE}" == "cwl" ]]; then
99
pip2.7 install --user cwl-runner cwltool==1.0.20160712154127 schema-salad==1.14.20160708181155 avro==1.8.1
1010
elif [[ "${LANGUAGE}" == "wdl" ]]; then
1111
wget https://github.com/broadinstitute/cromwell/releases/download/32/cromwell-32.jar
12+
elif [[ "${LANGUAGE}" == "nfl" ]]; then
13+
curl -s https://get.nextflow.io | bash
14+
mv nextflow $HOME/bin
1215
fi

main.nf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env nextflow
2+
3+
bamFile = file(params.bam_input)
4+
5+
process bamstats {
6+
input:
7+
file bam_input from bamFile
8+
val mem_gb from params.mem_gb
9+
10+
output:
11+
file 'bamstats_report.zip'
12+
13+
"""
14+
bash /usr/local/bin/bamstats $mem_gb $bam_input
15+
"""
16+
}

nextflow.config

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
manifest {
2+
description = 'Generate some stats on a BAM file'
3+
author = 'Andrew Duncan'
4+
}
5+
6+
params {
7+
bam_input = 'rna.SRR948778.bam'
8+
mem_gb = '4'
9+
}
10+
11+
process.container = 'quay.io/collaboratory/dockstore-tool-bamstats:1.25-6_1.0'
12+
docker {
13+
enabled = true
14+
docker.runOptions = '-u $(id -u):$(id -g)'
15+
}

script.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ if [[ "${LANGUAGE}" == "cwl" ]]; then
99
cwltool --non-strict Dockstore.cwl test.json
1010
elif [[ "${LANGUAGE}" == "wdl" ]]; then
1111
java -jar cromwell-32.jar run Dockstore.wdl --inputs test.wdl.json
12+
elif [[ "${LANGUAGE}" == "nfl" ]]; then
13+
nextflow run main.nf
1214
fi

0 commit comments

Comments
 (0)