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

Commit

Permalink
Merge branch 'release/1.25'
Browse files Browse the repository at this point in the history
  • Loading branch information
briandoconnor committed Oct 26, 2015
2 parents 42038da + aac5ed1 commit 1d20c4e
Show file tree
Hide file tree
Showing 7 changed files with 125 additions and 3 deletions.
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ MAINTAINER Brian O'Connor <[email protected]>
# Setup packages
USER root
RUN apt-get -m update && apt-get install -y apt-utils tar git curl nano wget dialog net-tools build-essential time
RUN apt-get -m update && apt-get install -y wget unzip openjdk-7-jre zip
# get the tool
RUN wget -q http://downloads.sourceforge.net/project/bamstats/BAMStats-1.25.zip
RUN unzip BAMStats-1.25.zip
RUN unzip BAMStats-1.25.zip && \
rm BAMStats-1.25.zip && \
mv BAMStats-1.25 /opt/
COPY bin/bamstats /usr/local/bin/
RUN chmod a+x /usr/local/bin/bamstats
CMD ["/bin/bash"]
39 changes: 39 additions & 0 deletions Dockstore.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env cwl-runner

class: CommandLineTool
description: "A Docker container for the BAMStats command. See the [BAMStats](http://bamstats.sourceforge.net/) website for more information."
id: "BAMStats"
label: "BAMStats tool"

dct:creator:
"@id": "http://orcid.org/0000-0002-7681-6415"
foaf:name: Brian O'Connor
foaf:mbox: "mailto:briandoconnor@gmail.com"
requirements:
- class: DockerRequirement
dockerPull: "quay.io/briandoconnor/dockstore-tool-bamstats:1.25"
- { import: node-engine.cwl }
hints:
- class: ResourceRequirement
coresMin: 1
ramMin: 4092
outdirMin: 512000
description: "the process requires at least 4G of RAM"
inputs:
- id: "#bam_input"
type: File
description: "The BAM file used as input, it must be sorted."
inputBinding:
position: 1
outputs:
- id: "#bamstats_report"
type: File
outputBinding:
glob: bamstats_report.zip
description: "A zip file that contains the HTML report and various graphics."
baseCommand: ["bash", "/usr/local/bin/bamstats"]
60 changes: 59 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,60 @@
# dockstore-tool-bamstats
A repo for the BAMStats command

A repo for the `Dockerfile` to create a Docker image for the BAMStats command. Also contains the
`Dockstore.yml` which is used by the [Dockstore](http://www.dockstore.org) to register
this container and describe how to call BAMStats for the community.

## Building Manually

Normally you would let [Quay.io](http://quay.io) build this. But, if you need to build
manually you would execute:

docker build -t briandoconnor/dockstore-tool-bamstats:1.25 .

## 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 briandoconnor/dockstore-tool-bamstats:1.25
# within the docker container
$ 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
```

## Running Through the Dockstore Descriptor Launcher

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
line utility. This is great for testing.

### Create Config File

Call it `launcher.ini`:

```
working-directory=./datastore/
```

### Make a Parameters JSON

This is the parameterization of the BAM stat tool:

```
{
"bam_input": {
"class": "File",
"path": "ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/phase3/data/NA12878/alignment/NA12878.chrom20.ILLUMINA.bwa.CEU.low_coverage.20121211.bam"
},
"bamstats_report": {
"class": "File",
"path": "s3://oicr.temp/testing-launcher/bamstats_report.zip"
}
}
```

### Run with Launcher

Run it using Java, make sure you have the dependencies installed for the Launcher, see the link above:

```
$ 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
```
5 changes: 5 additions & 0 deletions bin/bamstats
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -euf -o pipefail

java -Xmx4g -jar /opt/BAMStats-1.25/BAMStats-1.25.jar -i $1 -o bamstats_report.html -v html
zip -r bamstats_report.zip bamstats_report.html bamstats_report.html.data
1 change: 1 addition & 0 deletions launcher.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
working-directory=./datastore/
5 changes: 5 additions & 0 deletions node-engine.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class: ExpressionEngineRequirement
requirements:
- class: DockerRequirement
dockerPull: commonworkflowlanguage/nodejs-engine
engineCommand: cwlNodeEngine.js
10 changes: 10 additions & 0 deletions sample_configs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"bam_input": {
"class": "File",
"path": "ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/phase3/data/NA12878/alignment/NA12878.chrom20.ILLUMINA.bwa.CEU.low_coverage.20121211.bam"
},
"bamstats_report": {
"class": "File",
"path": "s3://oicr.temp/testing-launcher/bamstats_report.zip"
}
}

0 comments on commit 1d20c4e

Please sign in to comment.