Multi‑Sample Spatial Asset Packaging¶
Overview¶
run_cartload2_multi packages a joint multi‑sample FICTURE run (run_ficture2_multi) into per‑sample PMTiles and catalogs, and writes a shared multi‑sample catalog.
It reads the shared manifest ficture.multi.params.json from --fic-dir to discover the samples, then fans out one run_cartload2 per sample as a single Makefile so they package in parallel and fault‑tolerantly. Each sample is written to a self‑contained directory, and a top‑level multi-catalog.yaml ties them together.
Cell analyses are handled automatically
For each sample, any ficture.<prefix>.params.json present (e.g. cartloader, xeniumranger, produced by run_ficture2_multi_cells) is auto‑detected and forwarded to that sample's run_cartload2 as --in-cell-params. Background images (e.g. histology) are not handled here — add them per sample with import_image, or use run_together, which runs image import after packaging.
Requirements¶
- A joint FICTURE output directory (
--fic-dir) containingficture.multi.params.jsonand per‑sample results undersamples/<sample_id>/. - CLI tools used by CartLoad2:
tippecanoe,gdal,pmtiles,gzip/pigz,spatula(andpmpointwith--use-pmpoint).
Directory layout¶
With --id <multi_id> (default: the --out-dir basename), each sample is packaged into a self‑contained directory named <multi_id>-<sample_id>, so the whole --out-dir uploads to S3 as one unit:
1 2 3 4 5 | |
The multi-catalog.yaml records:
samples:— a relative pointer to each<multi_id>-<sample_id>/catalog.yaml(the only pointers into sample subdirectories);factors:— one entry per shared factor set, model-derived and cell-derived alike (e.g.t12_f24,cartloader), all with the same keys:post(the factor×feature matrix — its filename keeps its provenance suffix:-model.tsvfor an LDA model,-pseudobulk.tsv.gzfor cell clusters),rgb,de,info,umap({pmtiles, png, tsv}), andheatmap({pdf, tsv}, cell factors only).
Those shared files are materialized into the out_dir root next to multi-catalog.yaml — sourced from the FICTURE output (via the multi manifests) and processed with run_cartload2-consistent naming — so the catalog references only local basenames and out_dir is fully self‑contained.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | |
Example Usage¶
1 2 3 4 5 6 | |
Add --dry-run to write the Makefile and print the per‑sample commands without executing.
Parameters¶
Input/Output Parameters¶
--fic-dir(str, required): Joint FICTURE directory containing the multi manifest andsamples/<id>/.--out-dir(str, required): Output root; holds one<multi_id>-<sample_id>/per sample plusmulti-catalog.yaml.--id(str): Identifier for the run; per‑sample dirs are<id>-<sample_id>(default: basename of--out-dir).--in-multi-params(str): Name of the shared manifest under--fic-dir(default:ficture.multi.params.json).--multi-catalog(str): Output multi‑catalog filename under--out-dir(default:multi-catalog.yaml).--out-catalog(str): Per‑sample catalog filename (default:catalog.yaml).
Run Parameters¶
-j,--n-jobs(int): Number of samples to package in parallel (default: 1).--threads(int): Threads per job, forwarded torun_cartload2.--dry-run/--restart/--makefn/--log/--log-suffix.
Auxiliary parameters forwarded to each run_cartload2
Use defaults unless needed. Packaging: --in-fic-params, --out-fic-assets, --rename-x/y, --colname-feature/count, --out-molecules-id, --max-join-dist-um, --join-tile-size, --bin-count, --preserve-point-density-thres, --sge-scale, --use-pmpoint, --tile-format-pmpoint, --umap-colname-*, --umap-min/max-zoom, --skip-umap, --skip-raster, --tmp-dir, --keep-intermediate-files, --transparent-below/above.
Environment: --gzip, --pmtiles, --gdal_translate, --gdaladdo, --tippecanoe, --spatula, --pmpoint, --ficture2.
See the run_cartload2 reference for their meanings and defaults.
Output¶
Under --out-dir:
multi-catalog.yaml— the shared multi‑sample catalog (pointers + shared assets).<multi_id>-<sample_id>/catalog.yaml+ PMTiles and asset JSONs, one self‑contained directory per sample (seerun_cartload2→ Output).run_cartload2_multi.mk— the Makefile capturing all per‑sample targets.
For the upstream pipeline, see run_ficture2_multi; for a fully orchestrated end‑to‑end run, see run_together.