Installation Guide¶
This document walks through the environment setup and installation steps required for CartLoader.
In short: create an environment for the non-Python tools (Section 2), install CartLoader and its Python dependencies from the repository with uv or pip (Section 3), build the bundled tools (Section 4), and verify (Section 5).
1. Dependencies¶
Below listed all required tools and packages for CartLoader. Instruction of how to install those tools and packages are provided in the sections 2, 3 and 4.
1.1 Required System Utilities¶
Confirm that these command-line programs are installed:
gzipsortbgziptabixbcperl
1.2 External Tools and Utilities¶
These packages support spatial data handling and file conversion. Several are bundled as git submodules.
Python & Related Tooling
python3.10 or newer (verified with versions 3.10 and 3.13)uv(optional, recommended): a fast drop-in forpipparquet-tools
The Python packages that CartLoader needs are declared in its pyproject.toml and installed automatically in Section 3.
R & related Packages:
Rfrom CRAN(verified with versions 4.5.1)
External Tools (included as submodules)
punkst(the latest and more efficient implementation of FICTURE)spatulatippecanoemagickgo-pmtiles
Geospatial Utilities
Cloud & CLI Utilities
2. Setting Up the Environment using conda¶
We recommend isolating the project in a conda environment to avoid dependency conflicts. conda provides the Python interpreter and the non-Python tools (gdal, R, ...); the Python packages are installed from pyproject.toml in Section 3.
Without conda
If gdal, R and the other tools in Section 1 already come from your system (e.g. apt, Homebrew, or environment modules), you can skip this section and use a plain virtual environment instead; see Section 3.3.
2.1 Installing conda¶
If conda is not already available, download and install Miniconda or Anaconda.
Example installation of Miniconda3 on Linux:
1 2 3 4 5 | |
2.2 Creating an Environment¶
Set up a fresh environment for CartLoader:
1 2 3 4 5 | |
2.3 Install Core Dependencies¶
Install the non-Python dependencies once the environment is active:
1 | |
Install only these tools with conda. Leave the Python packages to uv or pip in the next section: having the same Python package installed by both conda and pip is a common source of conflicts.
2.4 Installing uv (optional)¶
uv installs Python packages much faster than pip and uses the same commands (uv pip install ...). Skip this step to use pip.
1 | |
3. Installing CartLoader¶
3.1 Installing the Python Package¶
Clone the repository, including its submodules, and install CartLoader with its Python dependencies. Run the install inside the activated environment from Section 2:
1 2 3 | |
1 2 3 4 5 | |
1 2 3 4 | |
The optional [ai] extra adds the packages for AI annotation of factors and cell clusters: run_together --anno / --anno-deep, anno_cartload_folder, and the annotate_* commands. Those commands also need the API key of the provider they call, set as an environment variable (ANTHROPIC_API_KEY, GEMINI_API_KEY, OPENAI_API_KEY or UMGPT_API_KEY).
Why an editable install (-e)
CartLoader reads its assets/ and the submodule binaries from the repository checkout, so it must be installed in editable mode, pointing at the checkout, rather than as a regular package. A git pull then updates the code without reinstalling; re-run the install command when the dependencies in pyproject.toml change (see Section 6).
3.2 Installing R Packages¶
1 | |
3.3 Alternative: a Virtual Environment without conda¶
If the non-Python tools come from your system instead of conda, create a virtual environment in the checkout and install into it:
1 2 3 4 | |
1 2 3 4 | |
Then install the R packages as in Section 3.2.
4. Initializing and Building Submodules¶
The --recursive clone in Section 3 already fetched the submodules. For a checkout cloned without it, fetch them now:
1 2 | |
To build all the bundled tools in one step (the same step the Docker image uses), run build.sh. It builds htslib, qgenlib, spatula, pmpoint, tippecanoe and punkst, and downloads the pmtiles and geotiff2pmtiles binaries; ImageMagick is not built (install it with conda in Section 2.3, or see Section 4.5).
1 2 | |
If a step fails, or to build a tool on its own, follow the sections below.
4.1 Installing spatula¶
Install spatula with its dependencies from the submodules directory:
1 2 3 4 5 6 7 8 9 10 11 | |
4.2 Installing punkst¶
Install the punkst toolkit to use FICTURE (Si et al., Nature Methods 2024).
Please follow the punkst installation guide.
Question
4.3 Installing tippecanoe¶
1 2 3 4 5 6 7 8 9 | |
4.4 Installing go-pmtiles¶
An easy way to install go-pmtiles is to download a release from the official website and decompress it. This provides a pmtiles binary ready for use.
Here is an example of its installation:
1 2 3 | |
4.5 Installing ImageMagick¶
Skip this step if ImageMagick was already installed via conda in Section 2.3.
1 2 3 4 | |
5. Verifying the Installation¶
Run the following commands to verify CartLoader and all dependencies:
1 2 3 4 5 6 7 8 | |
check_dependencies.py reads the Python dependencies from pyproject.toml. Packages of the optional [ai] extra are reported as optional and do not fail the check.
6. Updating CartLoader¶
1 2 3 4 5 6 | |
Rebuild the submodules (Section 4) when their versions change.