-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
84 lines (70 loc) · 2.29 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#-----------------------------------------------------------------------------
# Name: Dockerfile for bam2fastq
# Author: Jihoon Kim
# Modified date: 02/26/2016
# Description: Builds a Docker image to convert a .bam file to two .fastq
# files for pair-end read sequences
#
# Usage: Provide ${MyLocalDirectory} and ${MySample} to invoke 'docker run'
# sequentially as below.
#
# $ docker run -v /${MyLocalDirectory}:/mnt/data \
# -w /mnt/data -d \
# j5kim/bam2fastq:latest \
# /opt/workflow/sort.sh ${MySample}
#
# $ docker run -v /${MyLocalDirectory}:/mnt/data \
# -w /mnt/data -d \
# j5kim/bam2fastq:latest \
# /opt/workflow/split.sh ${MySample}
#-----------------------------------------------------------------------------
FROM ubuntu:14.04
MAINTAINER Jihoon Kim "j5kim@ucsd.edu"
# Set environment varialbes for directories
ENV TARGET_DIR /opt
ENV WORKFLOW_DIR /opt/workflow
ENV DATA_DIR /mnt/data
# create a target directory for installing applications
RUN mkdir -p ${TARGET_DIR}
# create a target directory for installing workflow scripts
RUN mkdir -p {WORKFLOW_DIR}
# create a workspace directory to put input files and create output files
RUN mkdir -p ${DATA_DIR}
# Update ubuntu packages
RUN apt-get update
# Install dependent ubuntu packages
RUN apt-get install -y \
build-essential \
git \
g++ \
libncurses5-dev \
libncursesw5-dev \
make \
python \
software-properties-common \
wget \
zip \
zlib1g-dev
# Install bedtools2
# https://github.com/arq5x/bedtools2
WORKDIR ${TARGET_DIR}
RUN git clone https://github.com/arq5x/bedtools2.git
RUN cd bedtools2
RUN make
RUN make install
### Install htslib (for samtools)
WORKDIR ${TARGET_DIR}
RUN git clone https://github.com/samtools/htslib.git
RUN cd htslib
RUN make
RUN make install
### Install samtool
WORKDIR ${TARGET_DIR}
RUN git clone https://github.com/samtools/samtools.git
RUN cd samtools
RUN make
RUN make install
### Download workflow scripts
WORKDIR ${WORKFLOW_DIR}
RUN wget https://raw.githubusercontent.com/jihoonkim/bam2fastq/master/sort.sh
RUN wget https://raw.githubusercontent.com/jihoonkim/bam2fastq/master/split.sh