Skip to content

Installing TACT

TACT is a Python-based tool that relies on several key scientific packages, including click, DendroPy, and NumPy, which are automatically installed when you install TACT.

For faster performance, especially with large datasets, using the PyPy 3 implementation of Python is recommended (when available), as it can significantly speed up analyses.

Which installation method should I use?

  • Docker (recommended): Easiest to install and fastest for large datasets. Works on Windows, Mac, and Linux.
  • pipx: Good alternative if you can't use Docker. Also supports PyPy for better performance.
  • Other methods: Not recommended or supported.

If you can use Docker, this is the recommended installation method. It's both convenient to install and fast for large datasets thanks to PyPy.

Install Docker Desktop and run the following to download the TACT image:

docker pull jonchang/tact:latest

Then, run TACT from the container image, giving it access to your current working directory:

mkdir -p examples
cd examples
curl -LO https://raw.githubusercontent.com/jonchang/tact/HEAD/examples/Carangaria.csv
curl -LO https://raw.githubusercontent.com/jonchang/tact/HEAD/examples/Carangaria.tre
docker run -it -v "$(pwd)":/workdir -w /workdir jonchang/tact tact_build_taxonomic_tree Carangaria.csv --output Carangaria.taxonomy.tre
docker run -it -v "$(pwd)":/workdir -w /workdir jonchang/tact tact_add_taxa --backbone Carangaria.tre --taxonomy Carangaria.taxonomy.tre --output Carangaria.tacted

Here's a screencast of how to use the Docker commands:

The above Docker image defaults to the latest tagged release. In the rare case you need to use a different version, a full list of tags is available on Docker Hub.

pipx

pipx is a tool that installs Python applications in isolated environments. This is a good alternative if you can't use Docker.

Basic installation

First, install pipx, then run:

pipx install tact

This installs TACT with the standard Python interpreter (CPython). This works fine for small to medium datasets.

Faster installation with PyPy

If you have PyPy3 installed, you can optionally install a faster version of TACT:

pipx install --python pypy3 tact

PyPy installation issues

  • This will take much longer to install than the standard version
  • Installation may fail if the proper dependencies (mainly openblas) aren't set up
  • On macOS, you'll need to run: brew install openblas gcc pypy3 pipx
  • You may also need to set environment variables:
    • PKG_CONFIG_PATH: should point to where openblas.pc lives (e.g., /opt/homebrew/opt/openblas/lib/pkgconfig)
    • MACOSX_DEPLOYMENT_TARGET: should be your macOS version (e.g., 11.0)

Verifying your installation

After installing, verify that TACT is working correctly:

tact_add_taxa --version

You should see the version number. If you get a "command not found" error, make sure TACT is in your PATH.

Next steps

Once TACT is installed, check out the Tutorial to learn how to use it, or read the Background to understand what TACT does.