Debian Codegraph @

paper/containers/data/hg37/bwa-index/build.sh

raw
1 # Note: The index commands require ~32G free memory -- more than we have on a
2 # desktop -- and Singularity can't mount Docker data volumes. Thus, we don't
3 # currently use this script. Instead, we copy the reference fasta to the
4 # cluster rather than getting it from the container. The Singularity command is:
5 # singularity run -H $(pwd) docker://jdidion/bwa /usr/local/bin bwa index hg37.fa
6
7 # create a data volume from the reference genome image
8 docker create -v /data/reference/hg37 --name hg37 jdidion/hg37_reference && \
9 # build the bwa index
10 docker run \
11 # create a local volume to store the output
12 -v $(pwd):/data/index/bwa/hg37 \
13 # bind reference data volume
14 --volumes-from hg37 \
15 # run bwa mem from bwa image
16 --rm jdidion/bwabase bash -c \
17 "cp /data/reference/hg37/hg37.fa /data/index/bwa/hg37 && \
18 bwa mem index /data/index/bwa/hg37/hg37.fa" && \
19 # create a new image that includes the index
20 docker build -f Dockerfile -t jdidion/bwa_hg37index . && \
21 # cleanup
22 rm -Rf bwa*index
23