Installation Guide¶
This page installs CartLoader on your own machine.
No installation needed with Docker
The prebuilt image hyunminkang/cartloader:latest contains CartLoader and every tool it uses. If you only want to run the pipeline, see Quick Start with Docker instead.
In short:
- Create an environment for the non-Python tools (Section 2).
- Install
CartLoaderand its Python dependencies from the repository withuvorpip(Section 3). - Build the bundled tools with
build.sh(Section 4). - Verify (Section 5).
1. Dependencies¶
Instructions for installing everything below are in Sections 2, 3 and 4.
1.1 Required System Utilities¶
Confirm that these command-line programs are installed:
make,gzip,pigz,sort,bc,perlbgzip,tabix(from htslib)
1.2 Build Tools¶
build.sh (Section 4) compiles several tools from source, which needs:
- A C/C++ compiler,
cmake,autoconf,automake,libtool,pkg-config,git - Development headers for
zlib,bzip2,liblzma,libcurl,openssl,libpng,libdeflate,TBBandOpenCV
On Ubuntu/Debian, the Dockerfile lists the exact apt packages. On macOS, install them with Homebrew.
1.3 External Tools and Utilities¶
Python & Related Tooling
python3.10 or newer (verified with versions 3.10 and 3.13)uv(optional, recommended): a fast drop-in forpip
The Python packages CartLoader needs, including parquet-tools, are declared in its pyproject.toml and installed automatically in Section 3.
R & Related Packages
Rfrom CRAN (verified with version 4.5.1). The R packages are installed in Section 3.2.
Tools Built from the Repository (git submodules, built by build.sh)
punkst: the latest, more efficient implementation of FICTUREspatulapmpointtippecanoego-pmtilesandgeotiff2pmtiles: prebuilt binaries thatbuild.shdownloads
Other Tools
- ImageMagick:
convert(ImageMagick 6) ormagick(ImageMagick 7);spatulauses it for image I/O gdalaws-cli, only for uploading to S3
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 (including parquet-tools) 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 | |
Then build the bundled tools with build.sh, the same step the Docker image uses:
1 2 | |
It builds htslib, qgenlib, spatula, pmpoint, tippecanoe and punkst, and downloads the pmtiles and geotiff2pmtiles binaries. ImageMagick is not built; install it with conda (Section 2.3) or see Section 4.5.
The tools must stay inside submodules/
CartLoader commands, and run_together in particular, look for these tools at fixed locations inside the checkout (for example submodules/punkst/bin/punkst and submodules/pmtiles/pmtiles), not on your PATH. Build them in place as below; a copy installed elsewhere is not found.
If a step of build.sh fails, rebuild that tool on its own as follows, then rerun build.sh or continue with the remaining tools.
4.1 Installing spatula¶
1 2 3 4 | |
build.sh builds htslib and qgenlib first, which spatula and pmpoint link against; build them first if you start from a clean checkout.
4.2 Installing punkst¶
punkst provides FICTURE (Si et al., Nature Methods 2024). Build it inside the submodule so that submodules/punkst/bin/punkst exists:
1 2 3 4 | |
For build prerequisites and troubleshooting, see the punkst installation guide.
Question
4.3 Installing tippecanoe¶
1 2 | |
CartLoader uses the binary built in place (submodules/tippecanoe/tippecanoe); make install is not needed.
4.4 Installing go-pmtiles and geotiff2pmtiles¶
Both are downloaded as prebuilt binaries for your OS and architecture:
1 2 3 | |
4.5 Installing ImageMagick¶
Skip this step if ImageMagick was already installed via conda in Section 2.3 or by your system's package manager.
1 2 3 4 | |
5. Verifying the Installation¶
Run the following commands to verify CartLoader and its dependencies:
1 2 3 4 5 6 7 8 9 10 11 12 | |
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.
Then try the local quick start.
6. Updating CartLoader¶
1 2 3 4 5 6 7 8 9 | |
Both steps matter after each update: new code may need a Python package added to pyproject.toml (a stale environment fails with an error such as requires the 'imagecodecs' package), and the pipeline passes options that only the tool versions pinned by the repository understand (an outdated build fails with an "unknown option" error or a usage message).