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

Commit 1d20c4e

Browse files
committed
Merge branch 'release/1.25'
2 parents 42038da + aac5ed1 commit 1d20c4e

File tree

7 files changed

+125
-3
lines changed

7 files changed

+125
-3
lines changed

Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@ MAINTAINER Brian O'Connor <briandoconnor@gmail.com>
1010
1111
# Setup packages
1212
USER root
13-
RUN apt-get -m update && apt-get install -y apt-utils tar git curl nano wget dialog net-tools build-essential time
13+
RUN apt-get -m update && apt-get install -y wget unzip openjdk-7-jre zip
1414
1515
# get the tool
1616
RUN wget -q http://downloads.sourceforge.net/project/bamstats/BAMStats-1.25.zip
17-
RUN unzip BAMStats-1.25.zip
17+
RUN unzip BAMStats-1.25.zip && \
18+
rm BAMStats-1.25.zip && \
19+
mv BAMStats-1.25 /opt/
20+
COPY bin/bamstats /usr/local/bin/
21+
RUN chmod a+x /usr/local/bin/bamstats
1822
CMD ["/bin/bash"]

Dockstore.cwl

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env cwl-runner
2+
3+
class: CommandLineTool
4+
description: "A Docker container for the BAMStats command. See the [BAMStats](http://bamstats.sourceforge.net/) website for more information."
5+
id: "BAMStats"
6+
label: "BAMStats tool"
7+
8+
dct:creator:
9+
"@id": "http://orcid.org/0000-0002-7681-6415"
10+
foaf:name: Brian O'Connor
11+
foaf:mbox: "mailto:briandoconnor@gmail.com"
12+
13+
requirements:
14+
- class: DockerRequirement
15+
dockerPull: "quay.io/briandoconnor/dockstore-tool-bamstats:1.25"
16+
- { import: node-engine.cwl }
17+
18+
hints:
19+
- class: ResourceRequirement
20+
coresMin: 1
21+
ramMin: 4092
22+
outdirMin: 512000
23+
description: "the process requires at least 4G of RAM"
24+
25+
inputs:
26+
- id: "#bam_input"
27+
type: File
28+
description: "The BAM file used as input, it must be sorted."
29+
inputBinding:
30+
position: 1
31+
32+
outputs:
33+
- id: "#bamstats_report"
34+
type: File
35+
outputBinding:
36+
glob: bamstats_report.zip
37+
description: "A zip file that contains the HTML report and various graphics."
38+
39+
baseCommand: ["bash", "/usr/local/bin/bamstats"]

README.md

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,60 @@
11
# dockstore-tool-bamstats
2-
A repo for the BAMStats command
2+
3+
A repo for the `Dockerfile` to create a Docker image for the BAMStats command. Also contains the
4+
`Dockstore.yml` which is used by the [Dockstore](http://www.dockstore.org) to register
5+
this container and describe how to call BAMStats for the community.
6+
7+
## Building Manually
8+
9+
Normally you would let [Quay.io](http://quay.io) build this. But, if you need to build
10+
manually you would execute:
11+
12+
docker build -t briandoconnor/dockstore-tool-bamstats:1.25 .
13+
14+
## Running Manually
15+
16+
```
17+
$ wget ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/phase3/data/NA12878/alignment/NA12878.chrom20.ILLUMINA.bwa.CEU.low_coverage.20121211.bam
18+
$ docker run -it -v `pwd`/NA12878.chrom20.ILLUMINA.bwa.CEU.low_coverage.20121211.bam:/NA12878.chrom20.ILLUMINA.bwa.CEU.low_coverage.20121211.bam briandoconnor/dockstore-tool-bamstats:1.25
19+
20+
# within the docker container
21+
$ java -Xmx7g -jar /opt/BAMStats-1.25/BAMStats-1.25.jar -i /NA12878.chrom20.ILLUMINA.bwa.CEU.low_coverage.20121211.bam -o test.html -v html
22+
```
23+
24+
## Running Through the Dockstore Descriptor Launcher
25+
26+
This tool can be found at the [Dockstore Descriptor](https://github.com/CancerCollaboratory/dockstore-descriptor) git repo. It lets you run a Docker container with a CWL descriptor locally, using Docker and the CWL command
27+
line utility. This is great for testing.
28+
29+
### Create Config File
30+
31+
Call it `launcher.ini`:
32+
33+
```
34+
working-directory=./datastore/
35+
```
36+
37+
### Make a Parameters JSON
38+
39+
This is the parameterization of the BAM stat tool:
40+
41+
```
42+
{
43+
"bam_input": {
44+
"class": "File",
45+
"path": "ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/phase3/data/NA12878/alignment/NA12878.chrom20.ILLUMINA.bwa.CEU.low_coverage.20121211.bam"
46+
},
47+
"bamstats_report": {
48+
"class": "File",
49+
"path": "s3://oicr.temp/testing-launcher/bamstats_report.zip"
50+
}
51+
}
52+
```
53+
54+
### Run with Launcher
55+
56+
Run it using Java, make sure you have the dependencies installed for the Launcher, see the link above:
57+
58+
```
59+
$ java -cp uber-io.github.collaboratory.launcher-1.0.2-SNAPSHOT.jar io.github.collaboratory.LauncherCWL --config launcher.ini --descriptor Dockstore.cwl --job sample_configs.json
60+
```

bin/bamstats

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
set -euf -o pipefail
3+
4+
java -Xmx4g -jar /opt/BAMStats-1.25/BAMStats-1.25.jar -i $1 -o bamstats_report.html -v html
5+
zip -r bamstats_report.zip bamstats_report.html bamstats_report.html.data

launcher.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
working-directory=./datastore/

node-engine.cwl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class: ExpressionEngineRequirement
2+
requirements:
3+
- class: DockerRequirement
4+
dockerPull: commonworkflowlanguage/nodejs-engine
5+
engineCommand: cwlNodeEngine.js

sample_configs.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"bam_input": {
3+
"class": "File",
4+
"path": "ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/phase3/data/NA12878/alignment/NA12878.chrom20.ILLUMINA.bwa.CEU.low_coverage.20121211.bam"
5+
},
6+
"bamstats_report": {
7+
"class": "File",
8+
"path": "s3://oicr.temp/testing-launcher/bamstats_report.zip"
9+
}
10+
}

0 commit comments

Comments
 (0)