Polarity-JaM: An image analysis toolbox for cell polarity, junction and morphology quantiﬁcation

application. We have developed data graphs for comprehensive visualisation of key statistical measures and suggest the use of an adapted polarity index when the expected polarisation direction or the direction of a global cue is known a priori . The focus of our analysis is on ﬂuorescence image data from endothelial cells (ECs) and their polarisation behaviour. ECs line the inside of blood vessels and are essential for vessel formation and repair, as well as for various cardiovascular diseases, cancer, and inﬂammation. However, the general architecture of the software will allow it to be applied to other cell types and image modalities. The Polarity-JaM package integrates these analyses in a reproducible manner with a level of documentation that allows the user to analyse image data accurately and efﬁciently. The software suite is documented at https://polarityjam.readthedocs.io and the app runs online at www.polarityjam.com .


Introduction
Cellular polarity is important in many biological phenomena spanning from developmental processes to wound healing and angiogenesis.Cell migration, cell division, and morphogenesis depend on prior polarisation and breaking of spatial symmetry.Spatial reorganisation of the plasma membrane, cytoskeleton, cell-cell junctions, or organelles is required to establish an axis of polarity with a distinct direction, meaning 'front and back', to guide directed processes (1).In these processes, cells have to adapt and react according to multiple and often conflicting cues from their environment (2).Fluorescence microscopy has become an invaluable tool for producing high-resolution, high-content images of in vitro systems as well as in vivo tissues.These images can be obtained at subcellular resolution of less than one micron, with multiple fluorescence channels acquired in parallel, often on multiple planes, allowing for detailed quantification of cellular polarity and asymmetries.At the same time, deep learning segmentation algorithms have developed at a staggering pace over the past few years, enabling the segmentation of individual cells and organelles with near-human accuracy (3)(4)(5)(6)(7)(8).This opens up a wealth of unprecedented possibilities, but also creates new challenges for comprehensible and interpretable image data analysis workflows that fully exploit these new potentials.Each cell has a unique shape, a particular spatial distribution of organelles, and contains different absolute amounts (measured by intensity) and distributions (gradients) of protein species.In addition, junctional cell-cell contacts exist with their own morphological phenotypes.Taken together, this image-based information provides a snapshot of a cell's state, which we aim to turn into quantitative and comparable features.We demonstrate our investigations on image data from endothelial cells (ECs).ECs line the inside of blood vessels and play a crucial role in organ function and health of the whole organism.Migration of these cells is important for vessel formation and repair, but can also be involved in disease processes in the cardiovascular system, cancer, or inflammation.ECs experience shear stress when blood flow passes through blood vessels, causing alterations at the collective and single cell level, including changes in EC polarity, alignment, shape, size, junctions, and gene expression.We describe some of the measurements and their biological correlates, see Fig.  cleus or the cell centre.For example, the position of nucleus and Golgi apparatus are used to compute orientation vectors for each cell, see Fig. 1 A,B.Nuclei-Golgi polarity has been positively correlated with directed motility (9) and cell orientation in tissue (10) in several cell types, including endothelial and epithelial cells.EC polarity can be induced by multiple signaling cues, including shear stress and VEGFA, which can be in competition with each other (11).Various EC shear stress sensors have been identified that induce EC polarisation, including Piezo1, plexinD1, focal adhesions (FA), the VEGFR2 / PECAM1 / VE-cadherin complex, or caveolae (12).As a result, ECs adapt their shape and orientation to shear forces (10,13).Cell shape is often measured using circularity, shape index, or length-to-width ratio (LWR).The LWR has been positively correlated with VEGFA treatment in all EC types (14), the collective signature also differs across organs and microenvironments (15).Collective cellular orientation has also been correlated with both shear flow types, pulsatile and laminar, which have been shown to organise collective EC phenotypes.Pulsatile flow does not organise the direction of orientation as strongly as laminar flow (16,17).
A major challenge in the creation of every image analysis pipeline is identifying and measuring informative features.This search has a large iterative component and is based on precise and accurate measurement of the relevant microscopy data (18).Several studies have proposed new meaningful measures such as Quantify Polarity (19), Junction Mapper (20) and Griottes (21) or reviewed existing ones (18).However, it is not yet possible to integrate these different aspects into a single pipeline and perform a multivariate analysis.These requirements and constraints motivated the development of the Polarity-JaM package, which is built to streamline the process of exploratory image analysis; this is accomplished by providing the end user with functionality that includes a wide range of features, explanatory metadata, clear and concise documentation, and high testing coverage.Proper meta-data and testing mean that parameters can be tuned safely and systematically, and the functionality of the three main components of the package can be -reasonablyextended to new types of analysis.All relevant analysis can be performed with our package, making installation and usage straightforward.For relevant terminology in our article, we provide a glossary at the end of the supplement, see Table S14.
To visualise and explore the wide range of cellular polarity, morphology, and junction features, we have developed an Rshiny application.In particular, our toolbox focusses on polarity data, which typically requires bespoke statistical tools for circular data that are not available in standard toolboxes.Circular statistics and correlations can be computed and visualised in scatter plots.We make use of phenotypic descriptors that provide the user with bonafide summary statistics that can be correlated with biological processes.For example, flow-mediated morphogenesis in EC collectives, which affects descriptors of cell elongation, cell shape, and nuclei orientation, as well as nuclei-Golgi polarity and changes in junctional morphology, can be directly correlated using circular statistics in our Web App.A central aim of our package is to aggregate diverse biologically descriptive statistics under the auspices of a single workflow that can measure multiple aspects of endothelial biology.In our Methods and Results section, relevant statistics are described and their combined use demonstrated.
In this article, we present Polarity-JaM, an open-source software suite for measuring cell features to describe collective behaviour in microscopic images.The engineering of features is a non-trivial task and requires biological ex-pert knowledge as well as deep understanding of the data and problem, which is explicitly addressed in our proposed pipeline.We will discuss several examples typical for EC flow assays, including quantification of polarity in subcellular organelle arrangement, orientation of cell and nuclei shape, subcellular signal asymmetries based on intensity measurements, subcellular localisation of signaling processes, and cell-cell junction morphology.In parallel, we will introduce informative statistical plots that allow to display all relevant information, including a circular histogram, the polarity index, confidence intervals and circular correlations -many of these useful measures are often omitted or rarely used in the quantification of collective cell systems.In summary, we propose a holistic image analysis workflow that is accessible to the end user in bench science.

Asymmetries in subcellular localisation of organelles.
Cell polarisation is a dynamic process that involves the reorganisation of various cellular components, including the cytoskeleton, intracellular signaling molecules, organelles, and the cell membrane.The nucleus is the most prominent organelle in eukaryotic cells and is constantly exposed to intrinsic and extrinsic mechanical forces that trigger dynamic changes in nuclei morphology and position (22).The centrosome is outside the nucleus, also referred to as the microtubule organisation centre (MTOC) and, unlike its name, is rarely located at the geometric centre of the cell (23,24).The Golgi apparatus is involved in the establishment of cell polarity by sorting and packaging proteins into distinct membranebound vesicles that are then trafficked to different parts of the cell (25).In most animal cells, the Golgi apparatus is one complex, and its position is frequently used as a read-out for cell polarity and indicator of migration direction.Note that there are several other organelles in other cell types that could be used as readouts, which are not discussed here.In summary, organelles are positioned around the nucleus, and their positions are crucial to many directed processes, such as cell division, directed migration, asymmetric adhesion, or heterogeneous cell-cell contact.Their positioning may have passive or active effects on crucial mechanisms, including Rho GTPase signaling, but also Map Kinase signalling (26,27).Sprouting angiogenesis and vascular remodelling are based on EC polarity and directed migration (28,29).A common readout in microscopic images of ECs in vivo and in vitro are relative nuclei-Golgi locations.In response to flow-induced shear stress, the Golgi is located upstream of the nucleus against the flow direction (10).The nuclei-Golgi polarity is often used as a proxy for the migration direction in static images.We will exemplify our approach using nuclei-Golgi positioning and nucleus displacement as read-out; see Fig. 2. We applied shear stress levels of 6 dyne/cm 2 and 20 dyne/cm 2 for 4 h under different media conditions, to induce robust collective polarisation of the EC monolayers (see Fig. 2).Microscopic images contained a junction channel, a nuclei channel, and Golgi staining.An example image is shown in Fig. S1A and Fig. S2.Using the Cellpose (4) algorithm, we obtained segmentations for cells and nuclei.Golgi segmentations were obtained by applying Otsu thresholding directly to the Golgi stained channel and superimposing the resulting mask with the cell segmentation from Cellpose.The results are shown in Fig. S1 B. The nuclei-Golgi vectors were automatically calculated for each cell, see Fig. 2 A. In tandem, we also obtained vectors from the cell centres to the nuclei centres, which provide a measure of the direction of nuclei displacement.The collective strength of polarisation is commonly measured using the polarity index (30), which is calculated as the resultant vector of all orientation vectors from each single cell.Mathematically we obtain a vector for every single cell, which in our example points from the nucleus to the Golgi: The average of the individual vectors is used to calculate the resultant vector from where N is the number of cells.The length of this vector, computed from R = r , is called the polarity index (PI) and its direction is the mean of the distribution.The value of the polarity index varies between 0 and 1 and indicates how much the distribution is concentrated around the mean direction.A polarity index close to 1 implies that the data are concentrated around the mean direction, while a value close to 0 suggests that the data are randomly distributed or spread in several directions.In summary, the polarity index indicates the collective orientation strength of the cell layer or tissue.Note that the polarity index is closely related to the variance of the distribution by S = 1 − R. In Fig. 2 B,D,E the value of the polarity index is shown and indicates the strength of the collective flow response.
To complement this analysis, we introduce a signed polarity index, which is a modified version of the V-score and is calculated to obtain the V-test statistics (31).The signed polarity index assumes a known polar direction.For example, if we assume that flow is orientated from left to right and ECs polarise against flow, we set the polar direction to an angle of µ 0 = 0 in our reference system, see Fig. 2 B. The signed polarity index is computed from: The signed polarity index varies between -1 and 1 and indicates the strength of polarisation with respect to an assumed polarisation direction.In our example, a value of -1 indicates that all cells are perfectly orientated against flow, while a value of 1 indicates that all cells are perfectly orientated with flow.For values in between, the distribution is more spread or diverges from the polar direction.Therefore, the  signed polarity index measures both the deviation from the expected polarity direction and the spread of the distribution.We suggest a graphical design for the representation of the polarity index, the signed polarity index, the polar direction, confidence intervals, circular histogram, and single measurements, see supplementary Fig. S3.The distribution of the polarity index (R) and signed polarity index (V) for N i = 30 images per condition is shown in Fig. S4 A, B for the nuclei-Golgi polarity and in Fig. S4 C,D for nuclei displacement.We found that the nulcei-Golgi polarisation of the ECs under shear stress is highly correlated with the displacement of the nuclei and points in the opposite direction, Fig. 2 B,C.We found the same behaviour for a wide range of flow conditions; see Fig. 2 D,E and Fig. S4 E, but with different magnitudes depending on the media conditions and magnitude of shear stress.Our web application includes a number of different statistical tests, including the Rayleigh test, the V-test, Watson test, and Rao's spacing test, see Supplementary Note 6.It should be noted that these tests are not appropriate for measurements of individual cells, given that the groups of single cells within a monolayer or tissue exhibit significant correlation.We therefore recommend the use of estimation statistics (32) to calculate effect sizes Fig. S4 of collective parameters such as the polarity index (R) and signed polarity index (V).
In (33) a systematic analysis has demonstrated that the V-test, which is based on the computation of the signed polarity index, is recommended over other tests if an expected direction is known a priori.Note that here we use the flow direction as the polar direction, whereas for the V-test the expected polarisation direction must be used.For the nuclei-Golgi polarity, for example, the expected polarisation direction points in the opposite direction to the flow direction, while for the nuclei displacement both the flow direction and the expected polarisation direction are the same.The signed polarity index in our data provides a more accurate or comparable distinction of all conditions with respect to control, in particular for 6 dyne/cm 2 and 20 dyne/cm 2 .In conclusion, it is advantageous to use the signed polarity index when the expected direction of polarisation or the direction of an external signal is known in advance.

Shape asymmetries.
Cell morphology is an important aspect of cell biology as it provides insight into the structure and function of a cell.Cell morphology can be used to study the effects of different treatments on cells, the effects of genetic mutations, to understand how cells interact with their environment, and to identify potential therapeutic tar-gets for disease.Furthermore, the cell shape is strongly connected to cell polarity, direction of cell movement, orientation of cell division, and organisation of the cytoskeleton.
The shape of the cell also affects the ability of cells to interact with their environment and to respond to external signals.There are also different effects on the organisation of molecules, the protrusion can function as small pockets and reaction chambers, while signaling gradients are more easily stabilised along the long axis of the cell than the short axis (27,34).Cell shape is also coupled with the migration direction; for example, in keratocyte-like motion, polarisation occurs along the short axis of the cell (35), while other cell types migrate along the long axis (36).
Recent studies have shown that monolayer orientation is modulated by both physical and chemical stimuli.Vion et al. (17) show that shear stress and VEGF-A act to modulate the cohesiveness of cell orientation in the endothelial monolayer.Physiochemical stimuli interact to modulate patterns of EC interaction across scales.As shear stress increases, endothelial cells polarise against flow, however, this phenotype is ablated with EC senescence.Furthermore, Deb et al. (16) demonstrated that cell size is modulated by shear flow.Longer exposure to shear flow decreases cell area, while increasing cell aspect ratio across longer (approx.48 h) time scales.The size of ECs has also been positively correlated with senescence (37).Laminar shear stress induces endothelial cell elongation (38).Alteration in substrate stiffness leads to changes in cell shape through mechanotransduction (39).Furthermore, cell shape can be an indicator of the mesoscale properties of tissue or cell monolayer and is often used as an order parameter in soft matter physics (40).In summary, cell shape and orientation are important readouts for directed cellular processes.
We applied our workflow to endothelial cells exposed to 6 dyne/cm 2 .The angle of the major axis of the cell or nucleus shape with the x axis serves as a readout for their orientation, see Fig. 3A,B.Here, any angle α i is identified with its opposite α i + 180, thus we do not distinguish the front and back of the cell (or nucleus).An angular histogram showing the angle distribution was then generated with our app, which in this case is mirrored on the x-axis.Note that angular data of cell shape and nuclei orientation angles are referred to as axial data, which means that all orientation angles α i , 1, • • • , N take values between 0 and 180 degrees.These axial orientation data were converted to directional data by doubling all values θ i = 2α i .The mean direction was calculated from ᾱ = θ 2 , where θ is the common circular mean of the directional data θ i .Similarly, the polarity index (R) was calculated as the length of the mean resulting vector of directional values θ i .Again, the polarity index varies between 0 and 1 and indicates how much the distribution is concentrated around the mean.A polarity index close to 1 implies that the data are concentrated around the mean direction, while a value close to 0 suggests that the data are evenly distributed or random.The V-score can be computed in the same fashion as for directed circular data (see Supplementary Note 6 for more details).
Changes in intracellular state or interactions with neighbouring cells can also induce changes in the shape of the cell and its organelles, in particular the nucleus (22).We tested the coupling of cell shape orientation to nuclei orientation in ECs and found a significant correlation, see Fig. 3. Similarly, we found that cell elongation and nuclei elongation are coupled.This shows that nuclei morphology and orientation can serve as a proxy for shape elongation and orientation.There are different commonly used measures of shape changes that we divide into two groups.The first group is determined by fitting an ellipse to the cell shape, identifying its major (longest) and minor (shortest) axes.However, this approach does not capture the complexity of protrusions such as filopodia or lamellipodia.The second group is computed from the relation of area and perimeter, such as, for example, circularity or shape index (40), see Materials and Methods for more details.In particular, the shape index has been popular in soft matter physics to characterise the mesoscale properties of tissues or cell monolayers as solid or fluid (41).

Quantification of intracellular signalling gradients.
Gradients or asymmetric distributions of signaling molecules are inherent in cell polarity.Often these asymmetries are decoded into rather small and subtle gradients that can be amplified by signaling feedback systems, such as the Rho GTPase system (42,43).The establishment of these signaling gradients within single cells allows cell collectives to respond to their environment in a coordinated manner and is used to control cell migration, differentiation, and other cellular processes (44).Quantifying the direction and strength of intracellular signaling gradients between different experimental conditions is therefore crucial to gain insight into the underlying processes.The notch signaling pathway is involved in the regulation of various genes responsible for angiogenesis (45) and has been shown to be a mechanosensor in adult arteries (46).Therefore, the effects of this pathway are of great interest.We present an automatic quantification approach of signaling gradients for each cell with the example of the NOTCH1 protein using our tool.We investigated both circular and linear features.First, the marker polarity is a novel circular feature, which can be described as the direction from the geometric cell centre to the weighted centre of marker intensity of the cell.Second, we computed the cue directional intensity ratio as a linear feature, which can loosely be described as the ratio between the mean intensities of the left-hand and right-hand cell-half of a cell perpendicular to a given cue direction.We provide a detailed description in the Materials and Methods section.The ratio takes values ranging from [-1, 1] where -1 indicates a strong asymmetry against a direction of the cue, 0 without visible effect, and +1 a strong asymmetry along the direction of the cue.An example image together with a visualisation of the cue directional intensity ratio and marker polarity is shown in Fig. 4 A (from left to right).A similar approach of using ratios on opposite sides of the cell was introduced by (47) to determine the magnitude and angle of polarity of a given cell.To investigate the polarity of the Notch1 signal, we compared ECs in static conditions and exposed to shear stress for a 2 h time period.The images contained a junction and nucleus channel as well as a NOTCH1 staining.The junction and nucleus channel were used for segmentation to then quantify the intracellular NOTCH1 signaling gradient.The result of the analysis is shown in Fig. 4 bottom row.We observed a shift in the marker cue directional intensity ratio when comparing static and shear stress conditions.We observed a rather small, but consistent change in mean, indicating a small gradient of the NOTCH1 signal, with a lower concentration on the flow facing side, Fig. 4 B. The results of the marker polarity analysis showed strong asymmetry effects, see Fig. 4 C, with large polarity index of 0.647 and 0.47 and V-score of 0.639 and 0.458 at 30 min and 120 min, respectively, while the mean was pointing along the direction of flow.This confirms the results from (46).A circular-linear correlation analysis between the polarity index and the directional intensity ratio of the cue revealed a correlation coefficient of 0.721, see Fig. 4 D, which implies a strong correlation between both measurements.Since signaling gradients in a single cell are rather small and sometimes noisy (48), ratio values are expected to be close to zero and show higher variance.However, the cue directional intensity ratio is a linear feature, easy to interpret, and can be compared between experimental setups, which is why we included it in our set of features.The marker polarity, on the contrary, is much more sensitive, but does not measure the magnitude of the gradients, but only their direction.
Localised marker expression of KLF4.To complement our investigation of signal intensity gradients, we also char-acterised the localisation of image-based signal intensities, which indicate the localisation of specific processes.Localisation of cellular processes in biological cells is important because it allows for precise regulation of downstream processes, such as gene expression, protein synthesis, signaling and other cellular activities.For instance, it is important whether molecules are localised at the cell membrane, where they might get activated via phosphorylation, or if they fulfil other functions through anchoring to the membrane.Localisation to the nucleus is also important for a variety of cellular processes, including gene expression or RNA processing.To quantify the signal in the different subcellular compartments, we compute the total amount and concentration of signal intensity, in the nucleus, the cytosol (without the nucleus) and the membrane nucleus, see Fig. 5 A. We demonstrate the capabilities of the Polarity-JaM pipeline, by quantifying the intensity ratio of Krüppel-like factor 4 (KLF4) in the nucleus with respect to the cytosol.KLF4 is a transcription factor that is known to be upregulated via exposure to laminar shear stress (49,50).We calculated the intensity of KLF4 in the nucleus and cytosol for static, after 4 h and 16 h of 6 dyne/cm 2 flow.We found a significant increase after 4 h of flow exposure in nuclei localisation compared to control and a slow decrease at 16h compared to 4h Fig. 5 B,C.For statistical comparison, we have used the DABEST method (51), see Fig. 5 C.

Junction morphology.
Cell-cell junctions underpin any architecture and organisation of tissue.They vary in different tissues, organs, and cell types and need to be dynamically remodelled in development, homeostasis, and diseases.For ex- ample, endothelial cell-cell junctions must provide stability and prevent leakage while also allowing dynamic cellular rearrangements during sprouting, anastomosis, and lumen formation (52).The organisation and topology of junctions and inversely the organisation and topology of endothelial cells contain a wealth of biological information.By analysing adjacency patterns in endothelial cells, organisational patterns that are associated with tissue phenotypes can be uncovered.There are vast differences in endothelial arrangement between different tissues and organs (53).
We are using the cell-cell contact features from an already published tool JunctionMapper to decipher cell-cell junctionrelated phenotypes (20).Note, that this tool is not adapted to studying EC in organs or in 3D tubular structures, which will be in the scope of future studies.The normalised junction features suggested in JunctionMapper allow one to quantify images of different resolution, cell type, and modalities.In our tool, the analysis is automatically performed in a region that is defined by the cell outlines, which we obtain from the instance segmentation using the proposed deep learning frameworks.This outline is dilated by a user-defined thickness.There are no more parameters necessary to define.The result can be seen in Fig. S1 C. The resulting area of the dilated outline is the interface area, which is computed for each single cell.We then derive the characteristic from a junction label, for example, VE-cadherin staining in the case of ECs, see Fig 6 A. The fragmented junction area results from Otsu thresholding in that region, see Fig. 6 B. Using these readouts, we can compute three features: (1) interface occupancy by computing the fragmented junction area over the interface area, (2) the intensity per interface area by computing the average intensity in the interface area, and (3) cluster density by the average intensity in the fragmented junction area.We find a unique signature of the three junction features in ECs after flow stimulation, see Fig 6 C, demonstrating the effectiveness of our method.In static condition, the cell-cell junctions are very heterogeneous, with some cells having thick junctions and high VE-cadherin intensity, while others have low signal intensity and low occupancy.Intensity and occupancy become more homogeneous within each field after exposure to flow.At 6 dyne/cm 2 the total intensity per interface area increases as well as the interface occupancy.At 20 dyne/cm 2 , however, the junctions become thinner, resulting in lower interface occupancy, while the intensity per interface area remains almost the same compared to static.At the same time, the intensity within the junction increases, resulting in higher values of cluster density.For the entire junction analysis workflow, only one additional parameter needs to be specified, namely the width of the automatically generated outlines that serve as regions of interest for cell-cell contacts.In summary, Polarity-JaM offers the possibility to fully automate the essential parts of the JunctionMapper workflow by setting a single additional parameter.
Reproducability, Replicability and Interoperability.Iterative acquisition of images and various experimental settings sometimes require complex folder structures and naming schemes to organise data, leaving the researcher with the problem of data structure and reproducibility of their analysis.To help with both tasks, the Polarity-JaM pipeline has three execution scenarios: a) single image, b) image stack, and c) complex folder structure.Furthermore, a comprehensive logging output is provided, as well as a standardised input structure in yml format.The generated outputs follow a naming scheme.The extracted collective and single cell features are stored in a csv file.The results of the statistical analysis from the app can be downloaded in various formats, including pdf and svg.For different categories or conditions, the Polarity-JaM app uses several qualitative colour schemes that are colour-blind friendly (54), the infrastructure follows a similar principle as PlotTwist, which was designed for time series analysis.Metadata and log information are also saved in a human-readable format on disk.Polarity-JaM uses wellestablished non-proprietary formats (such as csv, yml, tiff, svg) to aid interoperability, following a recommendation in (55).All statistical analysis for circular features shown in this study and more can be performed in the App.Our tool can be combined with other tools such as Griottes (21), polarity features can be mapped on spatial network graphs and their relation can be explored using the same segmentation.
Exploitative image analysis requires interactivity to quality check each analysis step.Hence, Polarity-JaM is designed with a simple Python API that is optimised for usage within a Jupyter Notebook (56).We provide several examples in our documentation on how to perform such an analysis.An overview of the entire Polarity-JaM software suite is depicted in Fig. 7.We additionally equip Polarity-JaM with a Napari (57) plugin with a graphical user interface to enable direct feedback on segmentation and features.Finally, Polarity-JaM is available via PyPI (Python Package Index).Taken together, we are committed to the principles of FAIR research (58).

Discussion
Our image data processing and analysis workflow can be used to simultaneously compute features of cell polarity, including organelle localisation, cell shape, and signalling gradients, allowing single-cell and collective high-content endothelial phenotyping.Circular statistics can be performed interactively via a web application.We also provide an informative graphical design for directional and axial data.We recommend the use of the signed polarity index when a polarisation direction is expected on the basis of an external polarisation cue, as is the case in most endothelial flow assays.
With the focus of the Polarity-JaM toolbox on a diverse fea- ture set and replicability and interactivity, we provide means for answering various biologically motivated experimental questions and for the extraction of aspects that are otherwise easy to overlook.For instance, collective orientation and cell size have been inversely correlated with endothelial cell senescence.Older endothelial cells tend to be larger and share a less pronounced direction of orientation (37).The orientation as a collective phenotype can be correlated with processes such as flow and senescence.Multivariate analysis, for example, including size in the image analysis, could perhaps differentiate between endothelial phenotypes by flow or those by cellular senescence.This investigation has been exemplified for endothelial cells, but can also be applied to other cell types such as the planar polarity of cardiomyocytes ( 59), epithelial cell tissues (19) and potentially other cell types.The image modality is not restricted to fluorescence microscopy but can be also applied to phase contrast or other -here the only restriction is that the image can be decomposed into masks of single cells.The current version of Polarity-JaM integrates different segmentation models, including Cellpose (8), microSAM (7) a fine-tuned model based on SAM (6), and DeepCell (5).There is a vivid community around all these segmentation algorithms (7, 8); therefore, we provide an interface to these models, which can also be adapted by the user.This will help maintain this software and ensure long-term use.Future development needs to address better segmentation of subcellular structures, including cell-cell junctions, cytoskeleton, and focal adhesion sites, using deep learning methods.The quantification of junctional morphology is based on the features suggested in ( 20) including junction occupancy, cluster density, and intensity per interface area.While these features provide good indicators for junctional changes and adaptations, they may not be exhaustive referring to the manual morphological classification of adherens junctions, which is frequently done in five common categories: straight junctions, thick junctions, thick to reticular junctions, reticular junctions, and fingers (60).To automate the translation into this classification, further work is needed on junction segmentation, as well as an advanced classifier using manual training data, which was not ready at the time of this publication but will be addressed in the future.Future challenges involve tissue and organoid image data in 3D space, which introduces more challenges in algorithmic development including robust segmentation (mainly due to the lack of training data), anisotropy in image acquisition, and the size of the image data.Also, efficient extraction of cell and nuclei features, which are by default not included in common packages, need to be developed.Multiplex imaging will stimulate further developments, as this image data modality dramatically increases the content of the information and therefore challenges meaningful feature extractions and comprehensive statistical spatial and circular approaches to compute cross correlations (61).The focus of this pipeline is on static images.However, the pipeline could also be applied to a series of images, and feature extraction would be performed for each frame.The extracted data can be stitched together by label identification (62).Computational models can be informed by a wealth of quantitative data through our approach, including vertex models (40), but also the cellular Potts model (35,63) or agent-based models (64,65).The spatial context of can be further explored using tools such as Griottes (21) and the circular version of Moran's I (66) to extract collective phenotypes.Mechanistically, this will also help to predict different states of tissues and dynamics from static biomedical images (41,67,68), which is an interesting avenue for future research with a wide range of applications.

Experimental setup.
Cell culture and fluid shear stress assays.Commercially available human umbilical venous endothelial cells (HU-VECs, pooled donors, PromoCell) were cultured and used at passages 2-4 at 37°C and 5% CO 2 humid incubator, in endothelial growth medium containing growth factors (EGM2, Lonza) for optimal cell growth.For passaging and fluid shear stress (FSS) assays, cells were washed once in sterile PBS, followed by a 5 minute incubation in Trypsin at 37 °C and 5% CO 2 , then neutralized with FBS and EGM2.Cells were centrifuged for 5 minutes at 480 g and counted.For FSS assays, cells were seeded in 0.4 ibiTreat Luer flow slides (Ibidi) coated with 0.2 percent gelatin at a cell concentration of 2 million cells per ml. 100 µl of cell suspension were added to each slide and incubated overnight at 37°C and 5% CO 2 .
The following day, the slides were connected to red perfusion sets assembled onto perfusion units (Ibidi) and connected to a pump (Ibidi).Laminar shear stress was applied at 6 dyne/cm 2 or 20 dyne/cm 2 for 4, 16, or 24 h inside a 37 °C and 5 % CO 2 humidity incubator.Static controls were kept in the same incubator for the duration of the experiment.
Immunofluorescence.At the end of a FSS assay, slides were disconnected from perfusion units and immediately fixated in 4 % PFA for 10 minutes, then washed 3 times in PBS.Slides were then blocked and permeabilized in CBB (Claudio's Blocking Buffer, see supporting information) for 30 minutes, followed by 1 h of incubation with primary antibodies at room temperature.Cells were washed 3 times with PBS, then incubated 1 h with secondary antibodies at room temperature, followed by another triple washing step, 5 minute incubation with DAPI, and finally mounted with a Mowiol + Dabco mixture in a 9:1 ratio.The primary and secondary antibodies used can be found in Table S1.
Confocal imaging.FSS immunostained slides were imaged on a confocal microscope (Carl Zeiss, LSM 980) using a Plan-Apochromat 20x/0.8NA Ph2 air objective.For each sample, 10 random positions throughout the flow slide were be selected and a Z-stack covering the entire depth of the monolayer were acquired.Slides were imaged with a twochannel setup, with channel one using the 488 and 633 lasers and channel two using the 405 and 561 lasers.Pinhole size was set to 1AU for both channels.

Image Analysis.
Segmentation.To isolate individual cells in a microscopic image, a process also known as instance segmentation, we used Cellpose, a deep neural network algorithm.Accurate instance segmentation can be created with pre-trained models it is provided with.These models can generalise well across both cell type and image modalities.For our analysis we used the model "cyto" for cell and "nuclei" for nuclei instance segmentation.For Golgi segmentation, Otsu-thresholding was performed.Subsequently, the segmentation mask was used to get the corresponding Golgi instance label.The performance of instance segmentation algorithms can vary for different modalities.Downstream analysis of features describing individual cells and their relationship with each other strongly depend on the quality of these segmentations.At this point Polarity-JaM offers three segmentation algorithms that the user can choose from: Cellpose, DeepCell, and microSAM.Additional segmentation algorithms are realised with the help of Album (69), a decentralised distribution platform where solutions (in this case implementations of segmentation algorithms) are distributed with their execution environment and can be used without additional overhead for the user.All of these show state of the art performance and are included in Polarity-JaM to enable segmentation for a broad range of modalities and cell types.
Single cell and organelle features.Common features are available within the regionprops scikit-image package (70).
We extend the available measurements by various features.For a complete list of all features, see the Appendix 3.
Most features require central image moments (71) that can be calculated from the raw moments m i,j = x y x i • y j • I(x, y), (5) with i, j = 0, 1... are exponents, x,y the pixel coordinates, where I(x, y) refers to the image intensity at position x,y.Generally, the centre of mass of a grey scale image (e.g. a channel) is now given by The central moments are then Shape orientation.With the central moments, we compute the orientation which describes the angle of the major with the x-axis in the interval [0, π] in radians or 0 to 180 degrees.Various features can be defined with the orientation, such as the cell shape orientation or the nucleus orientation in case the nucleus channel is provided.
Nucleus and organelle displacement.The displacement orientation from the nucleus to the centre of mass of the cell can be defined as where index r indicates moments that are calculated on a reference channel, and t moments that are calculated on the target channel.In the case of nuclei-Golgi polarity, the target is the Golgi channel and the reference the nuclei channel.
The orientation takes values in [0, 2π] in radians, which corresponds to 0 to 360 degrees, in this study.Analogously, the orientation from i) nucleus to organelle, ii) centre of mass of a marker channel to cell centroid, and iii) centre of mass of a marker channel to nucleus centroid can be defined.
Signaling gradient quantification.We define the for a cell, where A l is the area of the left cell half perpendicular along a given a cue direction θ and A cell the area of the cell.Mathematically, the area A l is described as with and vc = (cos(θ), sin(θ)), where the polar direction or expected cue direction θ is given in radians.
Circular statistics.All statistical methods were implemented in R and R-shiny.We have applied the statistical tests from the CircStats package (31) for directional and axial data.For measures on a linear scale, we applied the DABEST ('data analysis with bootstrap-coupled estimation') method from (51).
Availability, code, and issues.The pipeline was developed in Python and is available through PyPi (72).
The Polarity-JaM app can be used online via (www.polarityjam.com)without the installation procedure.Both the Polarity-JaM pipeline and the app can also be used offline.Additionally, both can be installed and used separately through album (69), a framework for scientific data processing with software solutions of heterogeneous tools.
The code for pipeline, app, and Napari plugin is published under the MIT licence and is available through GitHub (https://github.com/polarityjam).
Additional documentation and information can be found at readthedocs (https://polarityjam.readthedocs.io).Issues and requests are tracked on GitHub issues.Collaboration and extension are possible and welcome.Instructions and best practices can be found in the documentation.

1 .
The location or distribution of the organelle in the cell may be quantified in relation to the nu-Flow Static nuclei-Golgi polarity cell/nuclei shape and orientation cell/nuclei size punctate signal, e.g.focal adhesion fluorescent marker polarity and intensity junction marker asymmetry

Fig. 1 .
Fig. 1.A: Endothelial cells under static conditions have a random polarity, while endothelial cells exposed to flow (the direction is indicated by the black arrow) are polarised against flow (indicated here by the relative nuclei-Golgi polarity) and elongate.B: Examples of image-based cellular polarity, morphology, and cell-cell junction readouts in Polarity-JaM.

Fig. 2 .
Fig. 2. Asymmetric localisation of organelles as a measure for cell polarity.A: Human umbilical vein endothelial cells (HUVECs) in culture exposed to 20 dyne/cm 2 shear stress at 4 h.Nuclei-Golgi polarity [left] and displacement of the nuclei within each cell with respect to its centre [right].Orientation is indicated by a cyclic colour scheme and white arrows from the centre of the nuclei to the centre of the Golgi (nucleus-Golgi polarity) or from the centre of each cell to the nucleus (nucleus-displacement polarity).The flow direction is always from left to right.Scale bar 20 µm .B: Circular histograms of the distribution of cell orientations of a single image; the red arrow indicates the mean direction of the cell collective and its length is the polarity index.The red dashed lines indicate the 95% confidence intervals.Black dots indicate single-cell measurements.The grey arrow indicates the polar vector that points in the direction of flow, and the length of the black bar indicates the signed polarity index (V).C: Circular correlation of nuclei-Golgi polarity and nuclei displacement polarity.D: Ensemble plot of nuclei-Golgi polarity generated with the Polarity-JaM app for different flow conditions, each containing several hundreds of cells from Nr ≥ 3 biological replicates.E: Ensemble plot of the nuclei displacement orientation polarity generated with the Polarity-JaM app for different flow conditions, each containing several hundreds of cells from Nr ≥ 3 biological replicates.

Fig. 3 .
Fig. 3. Asymmetry in cell and nuclei shape and their orientation.A: Example input image.B,D: The major and minor axes of the cell (B) and nuclei (D) shapes are indicated with white dashed lines.The angle of the major axis with the x-axis serves as a readout for the orientation of the cells (B) and nuclei (D), which is indicated with a circular colour scheme ranging from 0 to 180 degrees.C: Circular correlation between cell shape orientation and nuclei orientation.

Fig. 4 .
Fig. 4. Notch signal signaling asymmetry in endothelial cell culture exposed to flow.A: Left shows the NOTCH1 signal (orange) combined with the junction channel (blue).Middle shows the NOTCH1 (here called marker) cue directional intensity ratio.The blue circle inside each cell marks the centroid of the cell, while the vertical dashed red lines are perpendicular to the flow direction and thus separate the cell to front and back.Right shows the marker polarity as a directional property.B: Shows the cue directional intensity ratio of the NOTCH1 signal with respect to the flow direction before [left], after 30 minutes [middle], and after 2h [right] of exposure to shear stress.Statistics mean +-std from left to right: -0.0026+-0.0539,0.0687+-0.0597,0.0512+-0.0609.C: The circular histogram of the polarity of the NOTCH1 signal before applying shear stress [left], after 30 minutes of exposure [middle], and after 2 h of shear stress [right].The red arrow points towards the collective mean direction of polarity, and its length represents the polarity index.Dashed lines indicate the 95% confidence intervals of the circular mean.Black dots indicate single-cell measurements.D: Correlation between marker polarity and directional intensity ratio.

Fig. 5 .
Fig. 5. Localised single-cell fluorescence intensity quantification.A: Quantification of the intensity of KLF4 antibody staining.Overlay KLF4 and junction channel [left], KLF4 intensity in the nuclei [middle] and in the cytosol without nucleus [right].B: Intensity ratio of the KLF4 reporter in the nucleus and in the cytosol was colour coded for each single cell.C: Statistical comparison of the change using the DABEST method shows a significant difference between static conditions and endothelial cells exposed to flow after 4 and 16 h.Each dot indicates a different image with N=50 -100 cells each.Black bars indicate 95 % confidence intervals of the mean difference.

Fig. 6 .
Fig. 6.Junction morphology quantification.A: Examples of endothelial cells in static condition, exposed to 6 dyne/cm 2 and 20 dyne/cm 2 .VE-cadherin staining is shown in blue.B: Pictograms of quantities extracted from the images.C: Statistical comparison of three normalized morphological junction features interface occupancy [left], intensity per interface area [middle] and cluster density [right] demonstrate a significant change in junction dynamics after exposure to flow.Black bars indicate 95 % confidence intervals of the mean difference.

Fig. 7 .
Fig. 7.The workflow enables processing large image data stacks for automated feature extraction.The Python API can be used to facilitate quality control with the help of a Jupyter Notebook.The results can be analysed statistically using a graphical user interface.

Table S2 .
All options and their input specification that can be specified in the parameters file sorted by category.and consistent errors in your data, this argument can be used during postprocessing.Lower values will result in more cells being detected.Higher values will result in fewer cells being detected.maxima_smooth float Controls what the model considers a unique cell.Lower values will result in more separate cells being predicted, whereas higher values will result in fewer cells.interior_threshold float Controls how conservative the model is in estimating what is a cell vs what is background.Lower values will result in larger cells, whereas higher values will result in smaller smalls. of neighbors of the cell.neighbors_mean_dif_1st Mean difference of the feature of interest to all first neighbors.neighbors_median_dif_1st Median difference of the feature of interest to all first neighbors.neighbors_stddev_dif_1st Standard derivation of the difference of the feature of interest to all first neighbors.neighbors_range_dif_1st Maximal range of difference of the feature of interest to all first neighbors.neighbors_mean_dif_2nd Mean difference of the feature of interest to all second neighbors.neighbors_median_dif_2nd Median difference of the feature of interest to all second neighbors.neighbors_stddev_dif_2nd Standard derivation of the difference of the feature of interest to all second neighbors.neighbors_range_dif_2nd Maximal range of difference of the feature of interest to all second neighbors.