Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dockerfile #40

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM debian:stretch-slim
WORKDIR /opt/gtc_to_vcf

RUN apt-get update && apt-get install -y wget bzip2 samtools
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda2-latest-Linux-x86_64.sh
RUN printf '\nyes\n' | bash Miniconda2-latest-Linux-x86_64.sh
RUN /root/miniconda2/bin/conda install -c miniconda numpy=1.11.2
RUN /root/miniconda2/bin/conda install -c bioconda pyvcf=0.6.8
RUN /root/miniconda2/bin/conda install -c bioconda pysam=0.9.0

COPY . /opt/gtc_to_vcf
RUN chmod +x /opt/gtc_to_vcf/scripts/download_reference.sh

ENTRYPOINT [ "/root/miniconda2/bin/python", "/opt/gtc_to_vcf/gtc_to_vcf.py" ]
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,42 @@ conda install -c bioconda pysam=0.9.0
```
where conda is a the package manager binary located in the installation location specified in the first step.

## Docker Usage

### Building
If you'd like to run GTCtoVCF without installing any dependencies (other than docker) you can build the docker image, i.e.:
`docker build -t gtc_to_vcf .`

### Running
The docker container takes the same arguments and options as the script.
But all inputs and outputs must be "mounted" from the host into the container via `-v`.
An example run might look something like this:
```
docker run -it -d -v /home/user/outputs:/outputs \
-v /home/user/inputs:/inputs \
-v /home/user/gtcs:/gtcs \
-v /home/user/genomes/:/genomes \
gtc_to_vcf --gtc-paths /gtcs \
--manifest-file /inputs/manifest.csv \
--genome-fasta-file /genomes/38/genome.fa \
--output-vcf-path /outputs
```

### Downloading the reference genome
You can call the download_reference.sh script without the samtools or GNU coreutils dependencies by overwriting the entrypoint of the container, i.e.:
`docker run -v $(pwd):/input --entrypoint=/opt/gtc_to_vcf/scripts/download_reference.sh gtc_to_vcf /input/genome.fa 38`

### Testing
1. (Optionally) Skip re-downloading the reference genome if you have a local copy of a genome fasta (.fa) and genome fasta index (.fai) file.
```
mv /location/of/genome.fa* tests/data
docker build -t gtc_to_vcf .
```
2. Run the tests
```
docker run --entrypoint=/root/miniconda2/bin/python gtc_to_vcf /opt/gtc_to_vcf/tests/test_class.py
```

## License

Copyright 2018 Illumina
Expand Down