Cell cortex segmentation in C. elegans PAR protein images
Project description
PAR Segmentation
Tools for segmenting, straightening and quantifying the cortex of cells. Works by combining spline-based segmentation with a custom quantification model, using a gradient descent optimisation procedure. Designed primarily for membrane-bound PAR proteins in C. elegans zygotes.
Instructions
As a first step, I would recommend checking out the tutorial notebook. To run the notebook interactively you have a few options:
Option 1: Binder
To run in the cloud using Binder, click here:
(Please note that it may take several minutes to open the notebook)
Option 2: Docker
Step 1: Make sure Docker is installed and open on your machine
Step 2: Download and run the Docker container:
docker run --rm -p 8888:8888 tsmbland/par-segmentation
Once the Docker image has finished downloading, this will print two URLs at the bottom for you to copy and paste into your web browser to open up Jupyter (please try both)
Step 3: Navigate to scripts/Tutorial.ipynb to run the notebook
Step 4: When finished, delete the image:
docker image rm tsmbland/par-segmentation
Option 3: Conda
You can use the environment.yml file to set up a Conda environment on your machine from which the notebook can be run
conda env create -f environment.yml
conda activate par-segmentation
jupyter notebook
Installation
To explore further and incorporate into your own analysis pipelines, you can install the package using pip:
pip install par-segmentation
Methods
Starting with an initial rough manual ROI of the cell edge, the cortex of the image is straightened (Step 1). The program then attempts to mimic this straightened image by differentiable simulation (Step 2). In doing so, it learns the position of the cortex, which enables the ROI to be adjusted (Step 3) and the cortex re-straightened.
Cortex positions are modelled as a spline with a user-specified number of evenly spaced knots which are optimised by gradient descent:
Cross-cortex intensity profiles at each position around the cortex are modelled as the sum of distinct cytoplasmic and membrane signal components: an error function and Gaussian function respectively, representing the expected shape of a step and a point convolved by a Gaussian point spread function (PSF) in one dimension:
The program learns the amplitude of these two components at each position around the cortex, so can serve as a quantification tool as well as a segmentation tool:
The model is a slight simplification of reality, and doesn't account for the possibility of a non-Gaussian PSF and complex 3D light-scattering behaviours, but is a close enough approximation for many purposes. Nevertheless, one can relax these assumptions if higher quantification accuracy is required. See here for an extension of the method designed for more accurate quantification.
Publications
Code in this repository has been used in the following publications for PAR protein segmentation and/or quantification:
Illukkumbura, R., Hirani, N., Borrego-Pinto, J., Bland, T., Ng, K., Hubatsch, L., McQuade, J., Endres, R.G., and Goehring, N.W. (2022). Design principles for selective polarization of PAR proteins by cortical flows. BioRxiv 2022.09.05.506621.
Ng, K., Hirani, N., Bland, T., Borrego-pinto, J., and Goehring, N.W. (2022a). Cleavage furrow-directed cortical flows bias mechanochemical pathways for PAR polarization in the C . elegans germ lineage. BioRxiv 1–32.
Ng, K., Bland, T., Hirani, N., and Goehring, N.W. (2022b). An analog sensitive allele permits rapid and reversible chemical inhibition of PKC-3 activity in C . elegans. MicroPublication Biol.
Rodrigues, N.T.L., Bland, T., Borrego-Pinto, J., Ng, K., Hirani, N., Gu, Y., Foo, S., and Goehring, N.W. (2022). SAIBR : A simple, platform-independent method for spectral autofluorescence correction. Development.
License
This work is licensed under a Creative Commons Attribution 4.0 International License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for par_segmentation-0.1.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db49eac5742e4da274bb365dc118e2ccd7d7685b36a3093f4d217d6bfebc1eb0 |
|
MD5 | b4873cf493a46e14c801c06c71af6ba9 |
|
BLAKE2b-256 | e417c73bb9ef5c79612d8d19803bf165876e6ca9ff0e01b4a41e9e3066bff8f4 |