Contains the following Python scripts and notebooks highlighting the image processing, analysis and modelling for Ng et al., 2025.
Segmentation
- We used a modified version of the par-segmentation developed by us previously, that includes an automatic roi finder for the zygote, by performing transfer learning on the MobileNetV2 architecture.
- An inbuilt GUI allows either the embryo poles to be defined via fitting the the embryo to an ellipse, and identifying the major axis of the cell. Cell pole's are defined as the position closest to the tip of the major axis.
- See example here.
Quantification
- Membrane profiles were quantified as before based on the par-segementation package, see example here.
- Clusters density was quantified using a combination of background subtraction with a laplacian of gaussians method, see example here.
Details and rationale of the modelling can be found in this supplementary.
Modelling for the simplified ODE PAR model.
- Base model
- Construction of paramater space varying antagonism terms.
- Stochastic model for calculating landscape stability.
Modelling for the simplified ODE one-species polarity model.
- Base model
- Fokker-Planck model for calculating landscape stability.
Modelling for simpified PDE PAR model.
- Runge-Kutta model for simulations and forward Euler's for dynamic feedback changes.
Modelling for full PAR model.
- Coarse fitting of anatagonism terms.
- Runge-Kutta solver for constructing parameter space.
- Forward Euler's model for simulations with dynamic antagonism terms, representing polarisation in P1 and P2.
Code developed here are all used in this paper.
This work is licensed under a Creative Commons Attribution 4.0 International License.

