This repository is a showcase of a pipeline of single cell segmentation and tracking to extract useful information (such as intensity over time) from fluorescence intensity images. This data was acquired during my PhD and the pipeline was used to analyze it. I present it here with two example datasets (an easy one as default and a difficult one), hoping it might be useful for me and others in the future.
The main goal was to extract average fluorescence intensity over time of single cells in different conditions. In order to do this the pipeline involves the following steps:
- Load data with Tifffile. Each channel is loaded independently as a separate 3D numpy array. Visualize that data -> scripts/01_image_exploration.ipynb
- Segment the nuclei using Hoechst stain channel using StarDist model. This segmentation is also done for every frame independently. -> scripts/02_stardist_nuclear_segmentation_plus_tracking.ipynb
- Segment the appropriate channel using Cellpose (cyto2 model). This segmentation is done for every frame (slice of 3D array) independently -> scripts/03_cellpose_segmentation.ipynb
- Track every segmented cell and every segmented nucleus in time using BayesianTracker
- Filter and / or select only cells and nuclei that you want for the analysis -> I have integrated point 4 and 5 in corresponding notebooks 02 and 03
- Calculate average fluorescence intensities for desider channels in cytoplasmatic and nuclear regions -> scripts/04_nuclear_cytoplasmatic_props.ipynb
- Optional: Manipulate / plot data as needed -> scripts/04_nuclear_cytoplasmatic_props.ipynb
I admit this my first time deploying a relatively-large project, and this onen is not exactly dependency-light. I have tried my best to create a conda environment that can be reproduced.
To run the pipeline create an environment using the env.yml file using conda.
conda env create --file env.yml
Then start a jupyter lab instance:
jupyter lab
- Python 3.7.6
- Windows 10.0.19043 Build 19043 (Windows 10 Pro)