Skip to main content Link Search Menu Expand Document (external link)

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 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 ./

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

Note: the GRCh38 reference is included in the Docker image, so you do not need to provide it unless you have special reference requirements.

Running PharmCAT

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

After running the file /path/to/data/sample.vcf through the preprocessor, assuming the sample ID was "SAMPLE1", you would have gotten a file called SAMPLE1.preprocessed.vcf. You can then run this through PharmCAT with:

# docker run --rm -v /path/to/data:/pharmcat/data pgkb/pharmcat ./pharmcat -vcf data/SAMPLE1.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).