Skip to content

Commit

Permalink
Merge pull request #76 from fnothaft/bwakit
Browse files Browse the repository at this point in the history
Use bwa-kit for alt aware alignment
  • Loading branch information
jvivian committed Jan 24, 2016
2 parents 48c63e4 + b7fbc8c commit 88fd598
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 85 deletions.
31 changes: 0 additions & 31 deletions bwa-postalt/Makefile

This file was deleted.

25 changes: 0 additions & 25 deletions bwa-postalt/build/Dockerfile

This file was deleted.

2 changes: 0 additions & 2 deletions bwa-postalt/runtime/.gitignore

This file was deleted.

15 changes: 0 additions & 15 deletions bwa-postalt/runtime/Dockerfile

This file was deleted.

12 changes: 7 additions & 5 deletions bwa/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,31 @@
build_output = runtime/bwa
runtime_fullpath = $(realpath runtime)
build_tool = runtime-container.DONE
git_commit ?= $(shell git log --pretty=oneline -n 1 -- ../bwa | cut -f1 -d " ")
name = quay.io/ucsc_cgl/bwa
tag = 0.7.12
tag = 0.7.12--${git_commit}

# Steps
build: ${build_output} ${build_tool}

${build_output}: build/Dockerfile
cd build && docker build -t ${name}-build:${tag} .
docker run -v ${runtime_fullpath}:/data ${name}-build:${tag} cp bwa /data
cd build && docker build -t bwabuild .
docker run -v ${runtime_fullpath}:/data bwabuild cp bwa /data

${build_tool}: ${build_output} runtime/Dockerfile
cd runtime && docker build -t ${name}:${tag} .
docker tag -f ${name}:${tag} ${name}:latest
docker rmi -f bwabuild
touch ${build_tool}

push: build
# Requires ~/.dockercfg
docker push ${name}:${tag}
docker push ${name}:latest

test: build
python test.py

clean:
-rm ${build_tool}
-rm ${build_output}
docker rmi ${name}-build:${tag}
docker rmi ${name}:${tag}
3 changes: 0 additions & 3 deletions bwa/build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,4 @@ RUN git clone https://github.com/lh3/bwa.git

WORKDIR /home/bwa

# specifically check out 0.7.12 release tag
RUN git checkout 0.7.12

RUN make
1 change: 0 additions & 1 deletion bwa/runtime/.gitignore

This file was deleted.

17 changes: 17 additions & 0 deletions bwakit/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM ubuntu

MAINTAINER Frank Austin Nothaft, fnothaft@berkeley.edu

RUN apt-get update && \
apt-get install -y \
curl

# pull down bwa-kit
RUN curl -L http://sourceforge.net/projects/bio-bwa/files/bwakit/bwakit-0.7.12_x64-linux.tar.bz2 \
| tar -xjC /opt/

# add wrapper script
ADD wrapper.sh /opt/wrapper.sh

# set entrypoint to bwakit
ENTRYPOINT ["/opt/wrapper.sh"]
19 changes: 19 additions & 0 deletions bwakit/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
build_tool = runtime-container.DONE
nametag = quay.io/ucsc_cgl/bwakit:0.7.12

build: ${build_tool}

${build_tool}: Dockerfile
docker build -t ${nametag} .
touch ${build_tool}

push: build
# Requires ~/.dockercfg
docker push ${nametag}

test: build
python test.py

clean:
-rm ${build_tool}
docker rmi ${nametag}
6 changes: 3 additions & 3 deletions bwa-postalt/test.py → bwakit/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import unittest


class TestBWAPostalt(unittest.TestCase):
class TestBWAKIT(unittest.TestCase):

def test_docker_call(self):
out, err = check_docker_output(tool='quay.io/ucsc_cgl/bwa-postalt:0.7.12')
self.assertTrue('k8 bwa-postalt.js [options] <alt.sam> [aln.sam]' in out)
out, err = check_docker_output(tool='quay.io/ucsc_cgl/bwakit:0.7.12')
self.assertTrue('Map paired-end reads to GRCh38+ALT+decoy+HLA and perform HLA typing:' in out)

def check_docker_output(tool):
command = 'docker run ' + tool
Expand Down
3 changes: 3 additions & 0 deletions bwakit/wrapper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

/opt/bwa.kit/run-bwamem $@ | bash

0 comments on commit 88fd598

Please sign in to comment.