Xenium End-to-End Pipeline¶
This tutorial walks through end‑to‑end processing of 10x Xenium data with CartLoader: converting inputs, running FICTURE, importing cell results and histology, packaging assets, and uploading to AWS for sharing.
Legacy
This tutorial uses run_xenium, a legacy orchestrator superseded by run_together, which runs the same stages for the standard Xenium layout and is the recommended workflow. The page is kept for existing users; see Legacy Orchestrators.
Known issue: combining --run-ficture2 with --run-cartload2 in one run_xenium call, as in the examples below, currently fails at the packaging step. Workaround: once FICTURE has finished, run run_cartload2 directly with --fic-dir <out-dir>/ficture2, then upload; see Legacy Orchestrators.
Prepare Input¶
Data Access¶
Download the ST data from the 10x Genomics Dataset portal.
If you have wget installed, use the following commands to download the output from 10X.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | |
If you have curl installed, use the following commands to download the output from 10X.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | |
Data Structure and Format¶
See details of the Xenium Ranger output at Xenium Ranger Official Documents
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | |
Naming Convention: transcripts.csv.gz or transcripts.parquet
1 2 3 4 | |
- "
transcript_id": Unique identifier for each detected transcript molecule. - "
cell_id": ID of the segmented cell associated with the transcript. - "
overlaps_nucleus": 1 if the transcript overlaps the nucleus mask, 0 otherwise. - "
feature_name": Feature name corresponding to the transcript (typically a gene). - "
x_location": X coordinate of the transcript. - "
y_location": Y coordinate of the transcript. - "
z_location": Z coordinate (depth) of the transcript. - "
qv": Quality value indicating confidence in transcript detection.
Cells
Naming Convention: cells.csv.gz
1 2 3 | |
Cell Boundaries
Naming Convention: cell_boundaries.csv.gz
1 2 3 | |
Clusters
Naming Convention: clusters.csv
1 2 3 | |
Differentially Expressed Genes
Naming Convention: differential_expression.csv
1 2 3 | |
Xenium output comes with tissue morphology images in OME‑TIFF, either nuclei‑only (DAPI) or multimodal (DAPI with cell boundary and interior stains). Each file uses a tiled, pyramidal layout (JPEG‑2000, 16‑bit grayscale) with levels from full resolution down to 256×256 for efficient interactive viewing.
morphology.ome.tif: A 3D Z-stack of the DAPI image.morphology_focus_0000.ome.tif: DAPI imagemorphology_focus_0001.ome.tif: Boundary (ATP1A1/E‑Cadherin/CD45)morphology_focus_0002.ome.tif: Interior — RNA (18S)morphology_focus_0003.ome.tif: Interior — protein (alphaSMA/Vimentin)morphology_mip.ome.tif: DAPI maximum intensity projection (MIP) of the Z‑stack.
Define ID and Parameters¶
1 2 3 4 5 6 7 8 9 10 | |
How to define Scaling Factors for Xenium?
--units-per-um means "coordinate units per micrometer" in your raw transcript coordinates.
For the Xenium example dataset in this tutorial, coordinates are already in µm, so use --units-per-um 1.
Check this value for your own dataset
Do not assume --units-per-um 1 is always correct. Always verify the coordinate unit in your input data.
If your coordinates are in pixels (or any unit other than µm), set --units-per-um to the correct value.
Example Runs¶
Choose one of the following options to run the run_xenium pipeline, either locally or with Docker.
In the following examples, only DAPI_OME image is deployed. Alternatively, CartLoader supports --all-images to deploy all detected images.
Run Pipeline Locally¶
Set Up Environment
1 2 3 4 5 6 7 8 9 10 | |
No tool paths needed
Once submodules/build.sh has run (see Installation), every CartLoader command finds spatula, punkst, tippecanoe, pmtiles, and pmpoint in the submodules/ directory of the repository, and the default color map at assets/default_color_map.tsv. Pass --spatula, --ficture2 (the punkst repository directory, which contains bin/punkst), --tippecanoe, --pmtiles, or --cmap-file only to use a different build or file. upload_aws runs the aws CLI from your PATH (--aws to override).
Example Command
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | |
Run Pipeline via Docker¶
Set Up Environment
1 2 3 4 5 6 7 8 9 | |
Using the Docker image
- The image's entry point is
cartloader: whatever follows the image name is acartloadersubcommand and its options (docker run --rm -v ${work_dir}:/data hyunminkang/cartloader:latest <command> [options]). - Paths passed to the command are container paths: with
-v ${work_dir}:/data, a host file${work_dir}/raw/x.csvis/data/raw/x.csv. - Every tool is built into the image, so no tool-path options are needed.
- Uploads need credentials inside the container: mount them read-only, e.g.
-v ${HOME}/.aws:/root/.aws:rofor AWS. latestis the most recent release; for reproducible runs use a dated tag (e.g.hyunminkang/cartloader:20261007-1432).
Example Command
The ~/.aws mount gives the container your AWS credentials for --upload-aws.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | |
Customize Parameters¶
Action Flags to Enable Modules
Actions
run_xenium runs multiple CartLoader modules together; enable and combine actions with flags.
CartLoader Modules |
Flags in run_xenium |
Actions | Prerequisites |
|---|---|---|---|
load_xenium_ranger |
--load-xenium-ranger |
Summarize Xenium Ranger outputs into JSON | Xenium Output files |
sge_convert |
--sge-convert |
Convert SGE to CartLoader format; optional density filter and visuals |
Xenium assets JSON (from load_xenium_ranger) or transcript CSV/Parquet |
run_ficture2 |
--run-ficture2 |
FICTURE analysis | SGE (from sge_convert); FICTURE parameters (--width, --n-factor) |
import_xenium_cell |
--import-cells |
Import cell points, boundaries, cluster, de; | Xenium assets JSON or manual CSVs; also --cell-id |
import_image |
--import-images |
Import background images (OME‑TIFF) → PNG/PMTiles; | Xenium assets JSON or --ome-tifs; also --image-ids or --all-images |
run_cartload2 |
--run-cartload2 |
Package SGE, optional FICTURE/cells/images into PMTiles; write catalog.yaml |
SGE, optional FICTURE assets or any imported cell/image assets; --id |
upload_aws |
--upload-aws |
Upload catalog and PMTiles to S3 | catalog.yaml (from run_cartload2); --s3-dir |
upload_zenodo |
--upload-zenodo |
Upload catalog and PMTiles to Zenodo | catalog.yaml (from run_cartload2); --zenodo-token |
Parameter Requirements by Action Flag
Below are explanations of the parameters used in the example. For the full list, see the run_xenium reference page.
| Parameter | Required when flags | Description |
|---|---|---|
--xenium-ranger-dir |
--load-xenium-ranger |
Xenium Ranger output directory to scan. |
--xenium-ranger-assets |
optional --load-xenium-ranger |
Output JSON manifest path (defaults under --out-dir). |
--width |
--run-ficture2 |
Hexagon width(s) in µm for training/projection. |
--n-factor |
--run-ficture2 |
Factor count(s) for FICTURE training. |
--cell-id |
--import-cells |
Asset ID/prefix for cell outputs. |
--image-ids or --all-images |
--import-images |
Choose specific image IDs or import all detected. |
--id |
--run-cartload2 |
Catalog ID (used in catalog.yaml and outputs). |
--s3-dir |
--upload-aws |
Destination S3 path (e.g., s3://bucket/prefix). |
--out-dir |
any action | Output root directory for generated artifacts. |
--dry-run, --restart |
optional (any) | Control execution (preview or rerun ignoring existing outputs). |
--n-jobs, --threads |
optional (any) | Parallelism for Make/GDAL/tippecanoe steps. |
Outputs¶
-

View/Explore¶
The outputs are available in CartoScope.
See output details in the reference pages for run_ficture2 and run_cartload2.