Progress, UI Ideas and dev strategies
photon-mosaic
is a pipeline and toolkit for automating preprocessing of multi-photon calcium imaging data.
It was designed to:
Estimated number of clicks per processing step per dataset: 5-30
Snakemake helps automate reproducible workflows.
Instead of writing:
You declare:
Snakemake tracks dependencies & reruns only what changed.
What could change?
Each rule specifies:
Snakemake builds a DAG (Directed Acyclic Graph) from these dependencies.
Only changed or missing outputs will be recomputed.
Organization of photon-mosaic
Flexible rules via “registration” of different functions:
preprocessing: derotation, contrast enhancement, etc.
postprocessing: detrending, neuropil correction, etc.
user-defined functions
rule suite2p:
input:
tiff=lambda wc: str(...)
output:
F=".../F.npy",
bin=".../data.bin"
run:
run_suite2p(input.tiff, output.F, output.bin, ...)
This uses logic and config patterns to determine filenames from the folder structure.
Force run the preprocessing
rule triggers the following DAG:
job count
------------- -------
all 1
preprocessing 40
suite2p 40
total 81
Reasons:
(check individual jobs above for details)
forced:
preprocessing
input files updated by another job:
all, suite2p
We follow the NeuroBlueprint data standard when writing our Snakemake rules.
derivatives/
for processed datasub-XXX/
for subjectsses-YY/
for sessionsfuncimg/
for functional imaging data# Dynamic path generation in Snakemake rules
processed_data_base / f"sub-{i}_{new}" / f"ses-{j}" / "funcimg" / f"{name}.tif"
This approach:
sub-0_230801CAA1120181
└── ses-0
└── funcimg
├── derotated_full.tif
└── suite2p
└── plane0
├── F.npy
└── ...
└── ses-1
└── ...
sub-1_230802CAA1120182
└── ses-0
└── ...
└── ses-1
└── ...
sphinx
Snakemake is powerful… but YAML, paths, and rule syntax can scare users.
A TUI (terminal user interface) could help:
In the TUI, we could let users:
.py
or .sh
fileThis allows non-developers to integrate their analysis into the pipeline without editing Snakefiles manually.
Possible TUI
Building with ChatGPT and Cursor.
LLMs accelerated my work on photon-mosaic by:
LLMs struggle as complexity grows:
photon-mosaic dev | 2025-05-19