PharmCAT in Docker

PharmCAT is available in a Docker container.


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


You will need to make your data accessible to the Docker container. There are many options, of which a volume mount is probably the best.

However, this tutorial will use bind mounts.

General usage:

# docker run --rm -v /path/to/data:/pharmcat/data pgkb/pharmcat <xxx>
Cleans up the container automatically when you're done with it
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.
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

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 -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 -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 U24HG010862).