Skip to content

Building PharmCAT

Binglan Li edited this page May 8, 2024 · 19 revisions

This page is meant for people interested in developing PharmCAT. If you only want to use PharmCAT, go to the PharmCAT website.

Requirements

Mac users: you may have an older version of make. If you have Homebrew installed, you can update make with:

# brew install make

Building PharmCAT

To build the PharmCAT jar that contains all dependencies:

# ./gradlew shadowJar

This will put a new JAR file in the build/libs directory with the current version number in the filename.

Alternatively, to build a local PharmCAT Docker image, run the following under the main PharmCAT folder

# make docker

⚠️ PharmCAT docker images support CPU with ARM or AMD architectures from v2.12.0 forward. If you use a PharmCAT docker image of previous releases and have a laptop with an Apple Silicon chip or any CPU with ARM architecture, you will need to set the PHARMCAT_DOCKER_PLATFORM environment variable to linux/arm64.

Many Python packages have yet to adopt the ARM CPU architecture. For example, you will run into varying errors when building a docker image with the python wheel package. See this page for details and possible solutions.

Testing PharmCAT

To test PharmCAT core:

# ./gradle test

To test PharmCAT against autogenerated VCF input:

# make allVcfTests
# make allMissingVcfTests

These tests will store metadata on the test results. While the number of failed allVcfTests should never go up, it's acceptable for the number of failed allMissingVcfTests as long as the relative increase in failures matches the relative increase in the number of tests.

These tests will also zip up all test data and results for analysis.

Autogenerated VCF Testing

  1. Generate allele definition overlap metadata (Binglan's script)
  2. Generate autogenerated VCFs (Scott's script)
  3. Split autogenerated VCFs into "should pass" and "should fail"
  4. Test autogenerated VCFs

Updating Data

This step requires Docker.

To update the data PharmCAT relies on:

# make docker
# make updateData

The make docker is only necessary to pick up any updates to the preprocessor. This step can be skipped if there are no changes to the preprocessor.

After updating the data, run all tests.

Committing the data

If there are no errors, commit all updated files (this will potentially include updates to test metadata). Make sure to include the updated data versions in the commit message.

Also upload the zipped test data to Box.