PharmCAT in Docker

PharmCAT is available in a Docker container.

Setup

If you are not familiar with Docker, this overview is a good starting point.

You must have Docker installed to use PharmCAT via Docker.

Then you can get PharmCAT from Docker Hub:

# docker pull pgkb/pharmcat

Usage

You will need to make your data accessible to the Docker container. There are several options to choose from, and you will have to decide what works best for you. For example, a volume mount is the best for persisting data, but will take some configuration.

This tutorial will use bind mounts because they are the easiest to use and requires no prior configuration.

General usage:

# docker run --rm -v /path/to/data:/pharmcat/data pgkb/pharmcat <xxx>
--rm
Cleans up the container automatically when you're done with it
-v
Bind mounts /path/to/data on your machine to /pharmcat/data in the Docker image. This will make the data available under the data subdirectory.
<xxx>
Command to run

If you run ls, it will list the contents of the /pharmcat directory:

# docker run --rm -v /path/to/data:/pharmcat/data pgkb/pharmcat ls
pharmcat_vcf_preprocessor.py
data
pharmcat
pharmcat.jar
pharmcat_pipeline
pharmcat_positions.uniallelic.vcf.bgz
pharmcat_positions.uniallelic.vcf.bgz.csi
pharmcat_positions.vcf
pharmcat_positions.vcf.bgz
pharmcat_positions.vcf.bgz.csi
preprocessor
reference.fna.bgz
reference.fna.bgz.fai
reference.fna.bgz.gzi
vcf_preprocess_exceptions.py
vcf_preprocess_utilities.py

Running the PharmCAT pipeline

The Pharmcat pipeline combines the VCF preprocessor and the core PharmCAT tool. You should be familiar with both tools and their requirements.

That said, this is the easiest way to run PharmCAT:

# docker run --rm -v /path/to/data:/pharmcat/data pgkb/pharmcat ./pharmcat_pipeline <vcf_file>

If you have a file /path/to/data/sample.vcf, you would use:

# docker run --rm -v /path/to/data:/pharmcat/data pgkb/pharmcat ./pharmcat_pipeline data/sample.vcf

Running the VCF Preprocessor

Your VCF files needs to comply with PharmCAT's requirements. PharmCAT's VCF Preprocessor will handle much of this for you.

# docker run --rm -v /path/to/data:/pharmcat/data pgkb/pharmcat pharmcat_vcf_preprocessor.py -vcf <vcf_file>

If you have a file /path/to/data/sample.vcf, you would use:

# docker run --rm -v /path/to/data:/pharmcat/data pgkb/pharmcat pharmcat_vcf_preprocessor.py -vcf data/sample.vcf

Running PharmCAT

# docker run --rm -v /path/to/data:/pharmcat/data pgkb/pharmcat pharmcat <vcf_file>

After running the file /path/to/data/sample.vcf through the preprocessor, if it was a single sample file, you should have gotten a file called sample.preprocessed.vcf. You can then run this through PharmCAT with:

# docker run --rm -v /path/to/data:/pharmcat/data pgkb/pharmcat pharmcat -vcf data/sample.preprocessed.vcf

The Docker image includes the pharmcat script, which is just a wrapper around the call to Java. For details on using PharmCAT, please see the Running PharmCAT.


PharmCAT is managed at Stanford University & University of Pennsylvania (NHGRI U24HG013077).