This repository has been archived by the owner on Aug 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
125 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
working-directory=./datastore/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |