This repository contains the code for the analyses in
Mogre SS, Li R, Scibisz A, Do TP, Dixon JC, Viana MP, Nazockdast E, Rafelski SM, Theriot JA, Riel-Mehan MM, Johnson GT. Geometry-aware modeling with cellPACK for evaluating spatial trends in intracellular organization. Protein Science (2026).
It compares the positions of peroxisomes and endosomes in the hiPSC single cell image dataset with models generated by cellPACK, and regenerates every computed figure and table in the paper from the released input data.
This project requires Python 3.11. The installation is managed using uv.
git clone https://github.com/mesoscope/cellpack-analysis.git
cd cellpack-analysis
uv sync --frozencellPACK is installed from the commit pinned in pyproject.toml
(5c31f56d89697f977f54ee001209eff92047b35c). Do not set CELLPACK or PYTHONPATH.
Every step runs through run_paper.sh, one stage per call. Run it without arguments to list the
stages.
1. Download the input data
bash cellpack_analysis/analysis/workflows/run_paper.sh fetchThis downloads 5 GB of archives and extracts them into data/ (31 GB). See the
data release README for the contents.
2. Run the analysis
bash cellpack_analysis/analysis/workflows/run_paper.sh analysisThis runs the stages below in order and writes the outputs to results/. Each stage can also be run
on its own. Set STRUCTS=peroxisome or STRUCTS=endosome to run one structure.
| Stage | Figures and tables | Runtime (peroxisome / endosome) |
|---|---|---|
calibration |
envelope calibration rates (Methods) | 27 / 28 min |
distance |
Fig 3, S5, S6b-c, S7b-c; Tables S2-S3 (single rules) | 42 min / 1.4 h |
distance-supp |
Fig S4 | 7.6 / 8.1 h |
occupancy |
Fig 4d (rule curves); Fig 5c, Table S4 (single rules) | 13 / 17 min |
fit |
Fig 4d (targets), S8a/c, S9a/c; fitted rule weights | 37 / 33 min |
validate |
Fig 5b-c, S6a, S7a, S8b/d, S9b/d; Tables S2-S4 (mixed rule) | 2.1 / 3.0 h |
ladder |
Fig S10 | 30 / 44 min |
biovar |
Fig 2b-f, S3, Table S1 (2f, S3c and S3e are drawn by manuscript) |
16 min |
illustrations |
Tables 1-2, Fig 4a-c, 5a, S1, S2 | 26 min |
manuscript |
figure panels and numbers sheets in results/manuscript_figure_assets_v4/ |
2 min |
Runtimes were measured on one node with up to 16 CPUs and 128 GB of memory. With both structures in
parallel, the full run takes about 9 hours. Table 3 lists constants from
cellpack_analysis/packing/rule_repository.py. Fig 1, Fig 2a and Fig 6 are not produced by this
code.
Notes:
data/must be writable. The analysis writes merged position files next to the packings.
The analysis uses the published packings, so repacking is not needed. Packing writes into the same
data/ paths as fetch. The packing stages submit SLURM jobs:
bash cellpack_analysis/analysis/workflows/run_paper.sh pack # 4 rules x 99 seeds
bash cellpack_analysis/analysis/workflows/run_paper.sh stage2-config # after fit
bash cellpack_analysis/analysis/workflows/run_paper.sh pack2 # mixed ruleRepacking reproduces the published positions exactly, except for the first seed packed after a
cell's grid is built. Once the grids are cached in data/structure_data/<id>/grids/, repack with
skip_completed: false to reproduce all 99 seeds. The sources-of-variation packings (Fig 2, S3,
Table S1) were made with older cellPACK commits (14225bcb, ae4f0aa6) and ship as inputs.
See the packing README for the options and for regenerating recipes without packing.
The inputs were derived from the Quilt dataset with the scripts in
cellpack_analysis/preprocessing/: segmented images, meshes (decimated with vtkDecimatePro,
target reduction 0.95), puncta positions, available space, and puncta size and count. Their outputs
ship with the input data, so this step is not needed to reproduce the paper.
cellpack_analysis/analysis/: analysis workflows, configs and illustration notebookscellpack_analysis/data_release/: input data download and the BioFile Finder / Simularium exportcellpack_analysis/lib/: shared librarycellpack_analysis/packing/: recipe generation and packingcellpack_analysis/preprocessing/: preprocessing of the Quilt datasettests/: tests
uv run pytest testsPlease cite the paper above. Citation metadata is in CITATION.cff.
Allen Institute Software License. See LICENSE.