macrohet is a code repository designed to investigate Macrophage heterogeneity. It accompanies the aforementioned manuscript exploring single-cell heterogeneity in Mtb-infected macrophages using time-lapse microscopy, tracking, and single-cell growth rate analysis.
Interactive figures and plots for this project can be explored via GitHub Pages: nthndy.github.io/macrohet
Image description: A pseudocoloured timelapse image of Mtb, projected along the time axis visualise spatiotemporal evolution.notebooks/: Reproducible analysis notebooks for data loading, segmentation, tracking, and quantificationmacrohet/: Python module with core analysis functionsdata/: Subset of image data with associated segmentation and tracksmodels/: Bespoke segmentation model and btrack tracking parametersdocs/: HTML manuscript and supporting content (hosted via GitHub Pages)environment.yml: Conda environment specification.pre-commit-config.yaml: Code formatting and linting hooks
The following instructions are configured for an Ubuntu workstation.
Clone the repository:
git clone https://github.com/nthndy/macrohet.git
cd macrohetCreate, install and activate the environment:
mamba env create -f environment.yml
mamba activate macrohetParts of the image tiling and stitching pipeline were adapted from Volker Hilsenstein’s DaskFusion project, used under the MIT License. Details of the hardware and software used to generate the analyses in this repository are provided in reproducibility.md.
To let the pipeline run end to end without the full dataset, the repository ships a
small example acquisition under data/:
data/untiled_images/— a down-scaled 3×3-tile Opera Phenix field of view (well r03c05), comprising the individual acquisition fields and theIndex.idx.xmlmetadata. This is the only example image input tracked in the repository.
Everything downstream is derived from this and is generated locally rather than committed, to keep the repository lean:
notebooks/tile_image.ipynbparses the Harmony metadata withdataio.read_harmony_metadataand stitches the fields into a contiguous mosaic withtile.compile_mosaic.- The save step writes the stitched mosaic to
data/example_data.zarr(OME-Zarr, recommended) ordata/example_data.ome.tiff(OME-TIFF).
These outputs are git-ignored; generate them by running tile_image.ipynb once after
cloning. The full processed single-cell dataset and the raw imaging data are held
externally, see the Data Availability statement for the repository DOI.
For questions or access to underlying data/code, please contact:
Nathan J. Day
Host–Pathogen Interactions in Tuberculosis Laboratory
The Francis Crick Institute
nthndy@gmail.com
@nthndy.bsky.social
github.com/nthndy
