Junction Mapper is a novel computer vision tool to decipher cell–cell contact phenotypes

Stable cell–cell contacts underpin tissue architecture and organization. Quantification of junctions of mammalian epithelia requires laborious manual measurements that are a major roadblock for mechanistic studies. We designed Junction Mapper as an open access, semi-automated software that defines the status of adhesiveness via the simultaneous measurement of pre-defined parameters at cell–cell contacts. It identifies contacting interfaces and corners with minimal user input and quantifies length, area and intensity of junction markers. Its ability to measure fragmented junctions is unique. Importantly, junctions that considerably deviate from the contiguous staining and straight contact phenotype seen in epithelia are also successfully quantified (i.e. cardiomyocytes or endothelia). Distinct phenotypes of junction disruption can be clearly differentiated among various oncogenes, depletion of actin regulators or stimulation with other agents. Junction Mapper is thus a powerful, unbiased and highly applicable software for profiling cell–cell adhesion phenotypes and facilitate studies on junction dynamics in health and disease.


Introduction
Tight contacts with neighbours to form a cohesive sheet of cells is a fundamental property of multicellular organisms and underpins organ development and function. Conversely, signalling pathways necessary to maintain junctions are often targeted by pathogens and underlie key mechanisms of diseases of the vasculature, heart and different epithelial organs.
Attachment to neighbouring cells has a distinct configuration in different cell types and is dynamically remodelled in homeostasis and diseases. In epithelial tissues, the characteristic cell-cell adhesion site appears as a straight and tense or stiff junction, represented by an apparent contiguous, adjoining staining of E-cadherin receptors (the epithelia-specific cadherin protein). Following stimuli such as growth factor treatment or oncogene expression in epithelial cells, the dynamic nature of cell-cell contacts is manifested in a variety of ways: disturbances in the configuration of the contacting interface between cells, fragmentation of cadherin staining or thinning out of the distribution of receptors from contacting cell borders (Braga et al., 2000;Erasmus et al., 2016;Frasa et al., 2010;Lozano et al., 2008;Nola et al., 2011).
However, a linear junction appearance does not apply to other cell types that also require strong cell-cell attachment. Intercalated discs, specialised junctions in cardiomyocytes, sustain considerable mechanical stress with heart beating (Ehler, 2016;Vermij et al., 2017). Extensive remodelling of the intercalated discs composition (Estigoy et al., 2009) and architecture is observed in cardiac 'aging (Sessions and Engler, 2016;Tribulova et al., 2015), diabetes-induced cardiopathies (Adeghate and Singh, 2014), arrythmogenic cardiomyopathies (Calore et al., 2015) and cardiac hypertrophy and failure (Lyon et al., 2015). During vascular homeostasis, endothelial cell-cell contacts may have a similar appearance as epithelial junctions (Dejana and Orsenigo, 2013;Malinova and Huveneers, 2018). Upon stimulation with inflammatory agonists (Radeva and Waschke, 2018), endothelial contacts undergo adjustments to increase permeability, changing from a linear to a zig-zag configuration and the appearance of gaps between cells (Malinova and Huveneers, 2018). Collectively, the above data demonstrate that distinct patterns of junctions are stimulus-dependent and reflect the specific destabilization (or strengthening) of cadherin receptors at contact sites in various cell types.
Despite the extensive scientific progress in our understanding of how cell-cell contacts are modulated, how these distinct phenotypes of junction modulation are fully attained is still unclear. A major road block to furthering mechanistic studies on junction regulation is the restricted capability and efficiency of the quantitative image analysis currently available. Existing imaging platforms (i.e. Cell Profiler) (Carpenter et al., 2006;McQuin et al., 2018) are fantastic resources for cell biologists. For Drosophila or nematode epithelia, several software are available for quantification of morphogenesis that robustly detect cell boundaries during morphogenesis (i.e. during dorsal closure or germ band extension) (Curran et al., 2017;Sumi et al., 2018). In contrast, for mammalian epithelial cells, available systems are not always suitable for the precise delineation of cell borders and the output of current pipelines is mostly morphometric parameters (i.e. cell size, shape, number or texture) (Campbell et al., 2017;McQuin et al., 2018;Yin et al., 2013). Cell-cell borders of mammalian cells are particularly difficult to detect because of cytoplasmic noise, irregular shapes (Held et al., 2011) and variable junction phenotypes, particularly when junctions are severely disrupted. This hitherto prevents an objective approach to analyse regulation of cell-cell contacts of mammalian cells and tissues.
Nevertheless, previous computer vision studies of mammalian junctions report the automated quantification of a single heterotypic junction (e.g. tumour-immune cell contact or host-pathogen contact) (Graus et al., 2014;Merouane et al., 2015), morphometry of mammary gland spheroids (Härmä et al., 2014) or dynamics of VE-cadherin contacts during cell rearrangements in angiogenesis (Bentley et al., 2014). Disruption of cell-cell contacts has been assessed in high-throughput manner by coupling junction segmentation with cell tracker and endothelia stimulation (Seebach et al., 2015), cadherin intensity at junctions (Erasmus et al., 2016) or indirectly, by increased inter-nuclear distance as cells scatter (Loerke et al., 2012).
Notwithstanding these successful studies, available methodology does not enable quantification of distinct patterns of organization of receptors or junction morphometry that are readily identified by the human eye. In addition, manual methods available for junction quantification rely on intensity levels and thresholding, which are not appropriate to detect junction attributes such as alterations in shape, length, fragmentation or continuity of cell-cell contacts. Non-intensity-based attributes of junctions are usually defined visually and/or painstakingly analysed via laborious user-dependent quantification of individual junctions. For example, the switch between a straight to undulated cellcell contact occurs without apparent changes in receptors levels at contact sites (Otani et al., 2006). In this case, rather than alterations of receptor levels at junctions, it involves impaired signalling of the small GTPase Cdc42 to modulate the amount of contraction, making cell-cell contacts less stiff and tense (Oda et al., 2014;Otani et al., 2006).
To address the above issues, we developed a semi-automated pipeline, Junction Mapper, which can fully capture the distinct patterns of junction perturbation by diverse stimuli in various cell types. It can efficiently (i) identify cell boundaries and cell-cell corners, (ii) describe phenotypes of junction architecture and (iii) quantify parameters that reflect the distribution and organization of junctional markers along the contacting interface. To broaden the software suitability to different models, we validate the robustness of the Junction Mapper software in endothelial cells and cardiomyocytes that show distinct receptor organization and architecture when compared to epithelial cells. The repertoire of parameters distinguishes subtle differences of junction disruption and provides a fingerprint for each stimulus, with insights into modes of action and how efficient and functional junctions are.
We envisage that the analytical capabilities of Junction Mapper will be invaluable for the scientific community to perform quantitative image analysis in mechanistic and translational studies of cell-cell contacts. Most importantly, the generation of tools to facilitate unbiased phenotype identification will be a major step forward to understand how junction dynamics are modulated in homeostasis and pathologies of different tissues.

Results
In normal epithelia, a junction between neighbouring cells usually appears as a straight, taut line, with E-cadherin receptors uniformly distributed along the contacting interface ( Figure 1A). Junctions are delimited by corners between three or more cells, where a specialised type of contacts are formed (tricellular junctions) ( Figure 1A). Distinct stimuli disrupt the above junction architecture in different ways, from minor reduction in levels to complete removal of adhesion receptors from contacting cells ( Figure 1B). Concomitant with changes in levels, junction configuration and architecture are also compromised, which are not always captured by intensity measurements.
We designed and validated a semi-automated system (Figure 2), Junction Mapper, that builds from our quantitative analysis of images from RNAi screens (Erasmus et al., 2016). Our previous software defines an E-cadherin mask to calculate the intensity specifically around junctions as a Image segmentation Figure 2. Junction Mapper -overview of quantification process. The original grey scale image stained for a junctional marker (E-cadherin) is uploaded in the program, which identifies the edge map of each cell semi-automatically to define the cell boundaries onto which measurements are made (skeleton, one pixel wide). This is superimposed onto the images to allow correction of missing boundaries and small errors interactively by the user. The image is then segmented to identify each cell to be quantified. A threshold is set to remove non-specific staining, and the skeleton is dilated (pixels) to select the area to be quantified that includes all staining at cell-cell contacts. Finally, cell corners are defined automatically or manually. Thresholded images are then quantified using the dilated mask and results are shown in Excel files as individual measurements of specific junctions as defined by the pairing of two different corners. Detailed steps are described in   contacts is considered. Junction Mapper implements novel quantification tools (corners, length and area) and a variety of novel primary and secondary parameters expressed per individual junction. The main advantage of Junction Mapper is to efficiently segment junctions in a variety of cell types and of different junction patterns, from linear to fragmented or disrupted contacts. The software detects the contacting interface between two cells and obtains a skeletonized edge map (summarised stepwise in Figure 2-figure supplement 1; see Materials and methods). Although semiautomated, users can adjust the outline manually by removing incorrect or adding missing lines, with subsequent refinement of the line location and geometry by the software algorithm (detailed in Appendix 1). A dilation step is applied (user controlled) to define the area to be quantified around the skeletonized map ( Figure 2-figure supplement 1). To identify individual junctions for further quantification, the software then automatically identifies each cell-cell corner (i.e. point of contact between three or more cells, see its mathematical definition in Appendix 1). The number and location of corners in each cell can also be manually adjusted by the user (Appendix 1).
Images obtained at different resolutions can be used for analyses in Junction Mapper (Supplementary file 1). However, the highest quality images possible should be used, as resolution may impact the ability to detect individual clusters of the junction marker. For defining the automated skeletonized edge of each image, a suitable signal-to-noise ratio is necessary to ensure enough contrast to differentiate staining at junctions from the cytoplasm (Figure 2-figure supplement 2). The higher the Peak Signal to Noise ratio, the easier it is for the program to automatically delineate the cell outline skeleton. For efficient skeleton definition the ratio should be above 22 dB (Figure 2-figure supplement 2). Using the automated skeleton as a start point, the user can refine the cell outline map by manually drawing or removing lines to close any gaps or correct deviations, particularly in cells with reduced staining at cell-cell contacts (Figure 2-figure supplement 1 to 2). The higher the fragmentation of junctions in the image, the more user input is necessary to define the final skeleton outline for quantification.
User-controlled threshold selection is done by inspection of the image with a slider component on the software interface (Appendix 1). Thresholding aims to reduce background without removing pixels from contact areas. The skeleton obtained is then projected onto the original thresholded image to segment the area of interest and proceed with quantification of each junction for up to two different junctional markers per image (see below). The measurement of the different parameters is performed simultaneously and automatically, in an unbiased manner ( Figure 2). The output per junction is produced as an Excel file that contains the selected image, skeleton and the quantification of pre-designed measurements and parameters (see below).

Primary parameters and validation
We envisage that different phenotypes of junction perturbation may require a distinct set of parameters to appropriately capture the disruption features ( Figure 1). Towards this goal, we propose a variety of parameters to be used as bona fide readouts and measure information that is based on intensity, area and length of the interface and cell-cell contact ( Figure 3A; Appendix 2). The following concepts are defined and used herein. Interface is the contacting membrane between two neighbouring cells and delimited by cell-cell corners. A cell-cell contact or junction is the region of the interface covered by adhesion receptors (e.g. cadherin staining). Junctions may or may not extend to the whole of the interface (corner-to-corner), and can appear fragmented or dotted (Figure 1, Figure 3A). Area is the dilated region around the skeleton and is set to encompass the width of a junctional marker staining (which can vary in thickness). Contour is the length measurement of the outline of the skeleton between defined points (interface or junction). Finally, the straight-line length is defined as the shortest distance (Euclidian distance) between corners that form the boundaries of one junction or interface.
Primary parameters obtain the basic metrics (area, contour and straight-line length) of each interface and junction selected in the monolayer ( Figure 3A, Appendix 2). A key innovation of the Junction Mapper is its ability to quantify junction marker staining that is not contiguous and that does not extend to both corners. New parameters assess area or contour occupied by fragments of the junctional staining (Fragmented Junction Contour and Junction Area). To validate the length-based measurements, individual contacts disrupted by H-Ras expression were quantified and, as predicted, decreasing values for the contour of the interface, junction or fragmented junction were revealed for each assessed junction ( Figure 3B Diagram highlighting the concepts that underpin the primary parameters measured by the software. An image of a cell with a hypothetical disruption of E-cadherin at cell-cell contacts is shown: stars mark the corners delimiting each contacting interface, and rhombus shapes mark the edges of each fragment of cadherin staining that we define as junctions. In each cell, measurements are made to assess the properties of each interface (corner-to-corner) and each junction (may be adjoining or disrupted in multiple fragments): the hypothetical length Figure 3 continued on next page decline between these three parameters, they did not decline to the same extent as the ones of junctions from expressing cells ( Figure 3C). The area-based measurements Interface Area and Junction Area of the same junctions followed similar pattern ( Figure 3D). We envisage that the primary parameters are useful to show extension or retraction of the contacting interface/junctions, increased fragmentation of the staining of junction marker or fluctuations of global staining intensity at cell-cell contacts. We next assessed the impact of user-defined settings (dilation and threshold) on the primary parameters. The variable dilation settings define areas for quantification and permits the user to account for different thickness of the staining at cell-cell contacts, wavy or undulated junctions. Increasing the dilated area did not affect the length of contacting interface or fragmented junction ( . Taken together, we concluded that the primary parameters measure the length and area of various features as predicted and are selectively modulated by user-controlled settings in accordance to their definition (Appendix 1).

Secondary parameters
The availability of a repertoire of parameters is a unique advantage of the software for mapping distinct phenotypes. Secondary parameters (Scheme 1, Appendix 2) are derived from the primary metrics above and aim to normalise the measurements to the size of each junction or contacting interface (length or area). The Linearity Index measures how straight an interface between two cells is, as proposed by Takeichi and colleagues (Otani et al., 2006). Coverage Index is a length measurement of the percentage of the interface length that is covered by the junction marker staining and has been previously used manually in the lab (Lozano et al., 2008). Three different parameters quantify the distribution of a junctional marker along the interface. First, Interface Occupancy, measures the area occupied by the marker within the Interface Area of each junction. Second, Junction Protein Intensity per Interface area calculates the fluorescence intensity within the Interface Area. Finally, Cluster Density is the junction protein intensity level within the area delimited by its staining (i.e. Fragmented Junction Area, which considers any fragmentation of the staining; additional parameters are described in Appendix 2). We predict that the secondary parameters are more useful to (straight line interface length or Euclidian distance between two points), the contour (connection of brightest pixels along the curvature of the staining/ interface) and area (defined dilated region around cell-cell borders). Intensity is also measured within the dilated area. (B-D) The primary parameters were validated to assess measurements were as predicted from their definition. Selected junctions from cells expressing activated H-Ras or controls (B) were quantified for length-based measurements (C, contours of interface, junction or fragmented junctions) or area-based measurements (D, areas of interface or junction). Diagrams at the bottom of graphs in C and D show the measurements performed. Coloured arrows point to selected junctions quantified. Each contacting interface is delimited by corners visualized by yellow squares. Scale bar = 10 mm. Detailed steps are described in Appendix 2. The online version of this article includes the following source data and figure supplement(s) for figure 3: Source data 1. Data used to validate length-and area-based primary parameters.    compare the accumulation or removal of specific markers, their density and relative changes when comparing across different samples.
The Coverage Index parameter calculated by Junction Mapper was validated by manual quantification using FIJI on cells expressing active Rac1 (Supplementary file 2A-B). The manual quantification used straight-line measurements (Lozano et al., 2008), rather than the more precise contour measurement by Junction Mapper (Scheme 1). Using either quantification, manual or Junction Mapper, a significant statistical difference was observed between values of control and Rac1-expressing cells (Supplementary file 2C). Lower values were obtained with the manual quantification method as predicted when using straight-lines for measurement. However, when controls values were compared between the two methods, no statistical difference was obtained (Supplementary file 2C). Scheme 1. Secondary parameters. (A) Novel parameters were defined to normalise the quantifications with respect to the area or length of contacts. The secondary parameters assess the configuration of the contacting interface (Interface Linearity Index), how much the staining of a junction marker occupies the interface length (Coverage Index) or area (Interface Occupancy). The distribution of junction marker is measured in two ways: their intensity levels within the area occupied by the junction fragments (Cluster Density) or the contacting interface (Ecadherin intensity at interface area). Detailed information of the calculation of parameters is described in Appendix 2. (B-D) Reproducibility of quantification by Junction Mapper in independent biological replicates. (B) Keratinocytes expressing activated Rac1 (green) or controls (non-expressing cells) were stained for E-cadherin (blue). (C-D) Images obtained from two independent biological replicates (replicate 1 and replicate 2) were processed to obtain the secondary parameters Coverage Index (C) or Interface Occupancy (D). Numbers at the top inside graphs show the number of junctions quantified in each sample from two biological replicates (N = 2); ns, non-significant. Arrowheads point to residual E-cadherin staining; thick arrow shows lack of cadherin staining. Scale bar = 20 mM.
Thus, the parameters give results as expected from previous manual methods. In addition, the reproducibility of secondary parameters was assessed in independent biological replicates by the same user. Across biological replicates of cells overexpressing active Rac1, the absolute values obtained for each sample were slightly different (Scheme 1B-D). However, the overall result is the same between replicates: a reduction of Coverage Index and Interface Occupancy of E-cadherin at junctions from Rac1 expressing cells (Scheme 1B-D). Comparison of control values between biological replicates (or between Rac1 expressing cells) was not statistically different.

User-bias validation
The robustness of Junction Mapper with respect to user bias was tested by: (i) defining the skeleton and corners and (ii) quantifying the same samples by different users. First, the quality control of skeleton and corners is subjective (Supplementary file 3A-B). Confluent epithelial monolayers with clearly defined junctions and corners produced less output variability from different users than images with disrupted contacts (Supplementary file 3A-D). We found that a particular hot spot for differences was the identification of cell corners in disrupted contacts, where corners are often not covered by cadherin staining (Supplementary file 3B). Second, pair-wise comparison of primary parameters of matched epithelial junctions obtained independently by two users showed significant differences (Supplementary file 3C-D).
However, when secondary parameters were calculated, the profiles obtained by the two users were similar, aside the absolute values being different (Supplementary file 3E-F, see also Figure 7figure supplement 1). This can be explained by the fact that the user-dependent variability partially auto-correct itself, as values are normalised to the interface and junction area or length which are non-reciprocally impacted by user bias. For example, a larger dilation setting will generate a larger junction area containing a higher number of E-cadherin pixels; when cluster density is calculated (Ecadherin intensity/fragmented junction area), the ratio will not differ extensively between different users.
We conclude that, in addition to the impact of dilation and thresholding settings, Junction Mapper results are impacted by user influence on the cell edge map. This influence is stronger in cell images with disrupted cell-cell contacts, where higher frequency of inaccurate corner and skeleton detection occurs. Hence more manual edge correction is required the more robust secondary parameter measurements should be considered. Furthermore, absolute comparisons can not be made between experiments. Instead, normalization of secondary parameters to controls in each replicate will facilitate comparisons.

Distinct oncogenes trigger different patterns of junction disruption in epithelia
We addressed whether Junction Mapper parameters could identify distinct features and patterns of junction disruption by different stimuli. We tested images of epithelial cells transfected with oncogenic Rac (H-Ras G12V ; Figure 4A), constitutively activated Rac1 (Rac Q61L ) or activated Src (Src Y527F ; Figure 4-figure supplement 1). Previous visual analysis indicated that perturbation of cell-cell contacts occurs more efficiently between two Rac Q61L -expressing neighbouring keratinocytes (Braga et al., 1997;Lozano et al., 2008). To validate this quantitatively, junctions were classified into two groups (i) between two expressing cells (ee) and (ii) between one expressing and one nonexpressing cell (en). Control junctions from the same image were quantified from cells without oncogenic H-Ras expression. Measurements of the primary parameters ( Figure 3) confirmed that junction contour and area were more severely disrupted when two neighbouring cells contained exogenous H-Ras G12V ( Figure 4D-E). The interface of mosaic contacts shared by expressing and non-expressing cells (en) were not significantly different from controls ( Figure 4B,C,F).
The interface between cells containing oncogenic H-Ras (ee) was significantly longer and larger than control cells (Interface Contour and Interface Area, Figure 4B,C). Irrespective of the longer contacting interface, the contour and the area of E-cadherin stained fragments were considerably altered upon expression of H-Ras G12V (Fragmented Junction Contour and E-cadherin Area, Figure 4D,E). Finally, the length between cell-cell corners was significantly longer between controls and two adjacent transfected cells (Straight-line Interface Length, Figure 4F). Based on the quantification of the primary parameters, oncogenic H-Ras expression induces a longer contacting interface between cells and a progressive fragmentation of E-cadherin staining.
The primary parameter measurements following expression of activated Rac1 Q61L or Src Y527F ( The above data may indicate that distinct subsets of parameters can differentiate alterations by different stimuli, thereby providing a unique disruption profile ( Figure 5). While data are from one technical replicate only, the high number of junctions quantified per sample is still sufficient to indicate significant differences among groups (Supplementary file 1). However, further experimentation is required to confirm the patterns observed.
The secondary parameters (Scheme 1) were designed so that the distribution of a junctional marker is normalised to the area or length of the interface or junction between neighbouring cells. Although Intensity is a primary parameter, it was also included here for comparison with other published studies. The patterns of the secondary parameters Interface Occupancy and Cadherin Intensity at Interface Area essentially followed the corresponding primary parameters E-cadherin Area and E-Cadherin Intensity (Figures 4 and  5). Yet, the differences between groups are more apparent in the secondary parameters: data are less scattered with fewer outliers when compared to primary parameters ( Figure 5).
We decided to focus on junctions that were shared by two transfected cells (ee), where phenotypes are clearer (Frasa et al., 2010;Lozano et al., 2008). Upon transfection of activated forms of H-Ras, Src or Rac1, a progressive disappearance of E-cadherin from the interface between cells was observed in different patterns ( Figure 5A,C,E). When compared to controls, the undulation of the interface was increased among cells expressing H-Ras G12V or Src Y527F (higher Interface Linearity Index, Figure 5B,D), but remained unchanged for Rac1 Q61L -perturbed junctions (ee, Figure 5F). These data indicate that, as E-cadherin is removed from junctions, the interface between H-Ras G12V and Src Y527F expressing cells becomes less tensile. The percentage of the interface area occupied by E-cadherin receptors was decreased in all samples (Interface Occupancy, Figure 5B,F), but did not reach significance in Src-expressing cells ( Figure 5D). The intensity levels of cadherin at junctions was significantly reduced following transfection of activated H-Ras or Src when measured as raw values (E-cadherin Intensity) or corrected per contacting area between two cells (E-cadherin Intensity per Interface Area) ( Figure 5B,D). In contrast, after active Rac1 expression, neither parameter was significantly changed. Consistent with the distinct phenotype of junction perturbation seen in Rac1 Q61L -transfected cells, the density of cadherin clusters was decreased in H-Ras G12V and Src Y527F , but slightly augmented in Rac Q61L .
These data are summarized as a diagram in Scheme 2. We concluded that Junction Mapper quantification can capture the various phenotypes of junction perturbation and collectively define a specific profile for each oncogene. Our preliminary observations suggest that activated Rac1 does not significantly reduce the overall levels of E-cadherin at junctions, since receptor intensity at the interface area is not reduced. Rather, Rac1 activation progressively redistributes receptors at the junction (reduced Interface Occupancy and higher Cluster Density), maintaining straight, linear junctions. In contrast, activated H-Ras or Src disrupt junctions via fragmentation and removal of E-cadherin consistently throughout the contacting interface (decreased in Interface Occupancy and Cluster Density), with concomitant undulation of cell-cell contacts (i.e. reduced tension or stiffness at junctions).

Dynamic range of the measurements of cell-cell contact phenotypes
Disassembly of junctions by oncogenes is a severe phenotype, often leading to complete dissolution of contacts. However, other stimuli (i.e. differentiation, protein depletion, growth factor or drug treatment) may induce a milder phenotype that is not easily quantified. We asked whether the Junction Mapper could efficiently detect small changes in E-cadherin levels or distribution under different conditions ( Figure 6). Datasets were obtained where the role of actin-regulatory proteins in junction formation was investigated in normal keratinocytes (Erasmus et al., 2016). Depletion of CIP4 (a regulator of cadherin trafficking) (Leibfried et al., 2008;Rolland et al., 2014), VAV2 (an exchange factor for Rho, Rac2 and Cdc42) (Vigil et al., 2010) or EEF1A (an actin bundling protein) (Mateyak and Kinzy, 2010) results in modest, but significant fluctuations in E-cadherin at junctions (20%-30%) using a thresholding method (Erasmus et al., 2016).
When analysed with Junction Mapper, CIP4, VAV2 or EEF1A siRNA did not interfere with the linearity of the contacting interface ( Figure 6B,D,F), in line with the appearance of normal, linear junctions. Consistent with our previous findings (Erasmus et al., 2016), a small decrease in E-cadherin intensity was observed in both CIP4-and VAV2-depleted cells ( Figure 6B,F), while EEF1A siRNA promoted the unusual phenotype of higher levels of cadherin receptors ( Figure 6D). These distinct patterns were also seen when E-cadherin intensity and area were normalized to the interface area (Intensity per Interface Area and Interface Occupancy, respectively). Strikingly, despite the similar Figure 4. Primary parameters quantification of H-Rasdependent junction perturbation. (A) Human normal keratinocytes were transfected with pRK5-myc-H-Ras G12V , fixed and stained with anti-E-cadherin and anti-myc antibodies. Images are shown of E-cadherin staining and myc staining as a marker of transfected cells. Coloured rectangles mark areas shown as a zoom on the left of the images and highlight control junctions (orange), junctions between expressing and non-expressing cells (en, purple) or between two transfected cells (ee, red). Arrowheads point to E-cadherin staining. (B-F) Quantification of the primary parameters using Junction Mapper. Graphs are plotted showing values of each parameter (Y axis) versus different junction types (X-axis). The parameter name is at the top of each graph and a diagram representing the quantification is shown on the left of its corresponding graph. Data is from one experiment (technical replicate) and the number of junctions analysed for each condition is found at the bottom of the graphs, below each scatter box plot. Statistical analysis was performed using One-way ANOVA, followed by Games-Howell post-hoc test. Nonsignificant (ns) and significant p-values (<0.05) are placed inside graphs. Scale bar = 20 mM or 10 mM (zoom images). The online version of this article includes the following source data and figure supplement(s) for figure 4: Source data 1. Primary parameters data to prepare   reduction in E-cadherin intensity levels following VAV2 and CIP4 depletion, receptors were removed in different ways from junctions. The clusters of cadherin receptors were less dense with lower levels of CIP4, while upon VAV2 siRNA, the density of the clusters slightly increased (Cluster density, Figure 6B,F).
Thus, the discrete changes in junctions result from reduced cadherin levels throughout the contacting interface by lower density of receptor clusters (CIP4 RNAi) or localised E-cadherin removal and redistribution into denser clusters (VAV2 RNAi; Figure 6B,F). In contrast, EEF1A depletion augmented E-cadherin Intensity and Cluster Density along the interface. Taken together, these data highlight the ability of the Junction Mapper to detect phenotypes reproducibly and with good dynamic range. Scheme 3 summarizes the changes and distinct profiles detected by Junction Mapper in our validation experiments.    Source data 1. Secondary parameter data on oncogenic junction disruption used for Figure 5 graphs.

Endothelial junctions and cardiomyocyte intercalated discs
We next asked whether the software would be applicable to endothelial cells and cardiomyocytes that can have junctions differently shaped when compared with epithelial contacts. Both types of junctions are considerably more fragmented than epithelial contacts, and thus it was not clear whether the parameters quantified by the Junction Mapper would be suitable. Thrombin is a serine protease that stimulates protease-activated receptor (PAR) in endothelial cells to increase vascular permeability in inflammation and injury ( Figure 7A) (Kumar et al., 2009). Visually, the junctions of endothelial cells treated with thrombin are quite distinct (Malinova and Huveneers, 2018), but so far it has not been possible to evaluate differences quantitatively. There were no significant changes in the Interface Linearity Index ( Figure 7A,B), consistent with the limitation of Junction Mapper to skeletonize zig-zagged junctions and thus measure their length (Figure 3-figure supplement 2E-F).
However, with appropriate dilation values (Supplementary file 1, Figure 3-figure supplement 1), alterations were detected for area-based measurements. In thrombin-treated cells, VE-cadherin distribution along the interface area (Interface Occupancy), intensity of VE-cadherin staining and normalised intensity per contacting interface were substantially higher ( Figure 7C-E). The density of VE-cadherin clusters was also enhanced upon treatment with thrombin ( Figure 7F), implying that a higher number of receptors is recruited per contact area. Of note is that the analysis of stimulated endothelial cells, with their typical junction morphology and gaps, was strongly influenced by the user-controlled settings ( Rat neonatal cardiomyocytes were treated with phenylephrine (PE) as a model to induce hypertrophy (Miragoli et al., 2011;Simpson, 1985). Cells were co-stained with b-catenin as a junctional marker and connexin 43 ( Figure 8A), a protein found in gap junctions, a structure necessary for synchronization of cardiomyocyte beating. The appearance of both markers at junctions was considerably fragmented (dotted appearance; Figure 8A), suggesting that parameters that consider the staining area would be the most appropriate. The software used the skeleton and dilated area of b-catenin as a mask as described by Erasmus et al. (2016) to segment the area where connexin 43 was localised. The Interface Linearity Index of b-catenin ( Figure 8B) or connexin 43 ( Figure 8C) was not significantly altered upon induction of hypertrophy in cellulo. Instead, hypertrophy stimulation promoted higher Interface Occupancy and higher levels of b-catenin and connexin 43 at junctions (raw intensity or corrected by the interface area; Figure 8B,C). However, the density of b-catenin clusters was significantly reduced, while connexin 43 density was augmented in PE-treated cells, in a small but significant manner. Thus, the two markers are modulated differently by hypertrophy stimulation in cellulo. Increased levels of b-catenin are achieved by less dense clusters spread along the interface, while connexin 43 molecules are clustered more densely, suggesting localised stimulation of gap junction formation. These data demonstrate the use of Junction Mapper for multiple cell types and its power to correlate the distribution of different proteins at cell-cell junctions. The data from cardiomyocytes and endothelial cells are summarized in Scheme 4. A heuristic approach on how to define the userdependent settings and the parameters to use for these cell types are described in Supplementary file 4.   Source data 1. Data from siRNA experiments used in graphs in Figure 6B, D and F.

Discussion
Junction configuration and adhesion receptor organization at contact sites are maintained via a complex interplay of distinct cytoskeletal filaments and associated regulatory proteins, with an exquisite regulation by diverse pathways and cellular contractility. At cell-cell contact sites, the challenge remains to translate the regulation of junctional components into functional and appropriately shaped cell-cell contacts. Junction Mapper facilitates the profiling of cell-cell contact behaviour with a variety of novel parameters in a fast, robust and reliable manner. Collectively, the parameter repertoire indicates how effective cell-cell adhesion is, identifies altered patterns of receptor distribution and guides experimental design to unravel the underlying molecular mechanisms. Junction Mapper provides a semi-automated computer vision solution with broad applicability. The most innovative aspects of Junction Mapper are, first, the measurement of receptor density and occupancy, via the normalization of the junction marker intensity, length and area to the available contacting interface and cell-cell contact area. Second, the automatic quantification of fragmented staining at a junction, which has not been feasible previously and, third, the correlation of the parameters from two junctional markers along the same junction. Underpinning the above aspects is the ability of Junction Mapper to detect cell borders and corners when considerable disruption is observed. Machine learning algorithms certainly have the potential to improve and automate segmentation success, especially of highly fragmented contacts. However, the availability of training image datasets with boundaries manually-generated is still a bottleneck (Häring et al., 2018). One possible use of the software is therefore the generation of precise cell outline skeletons that can be used to train machine-learning algorithms in the future.
While semi-automation has been implemented during the image processing by Junction Mapper, user contribution is necessary and essential to perform the quality control of skeleton outline, corner positioning and setting up the dilation and threshold levels in a given dataset. User bias is particularly relevant in images with very disrupted and irregular junctions, and absolute values are not suitable for comparison across experiments in some cases. However, user bias can be minimized. Analysis of biological replicates or independent analysis by different users show that (i) the secondary parameters are more robust against user bias and (ii) obtained results are similar across replicates when comparing control and treated samples.

Interface Linearity Index
Cluster Density  The software can detect both major and minor changes at junctions in different experiments. Unexpected and distinct profiles emerge from junction disruption by oncogenes that potently remove E-cadherin from contacts. The junctional defects caused by H-Ras G12V or Src Y527F illustrate the novel parameters that measure junction fragmentation and the specific density of E-cadherin in remaining fragments. In contrast, the perturbation profile induced by expression of Rac1 Q61L is not appropriately quantified by intensity alone and may be better assessed by 'Interface Occupancy', 'Coverage Index' and 'Cluster Density'. Among the repertoire of pre-defined parameters, we find that a subset is highly likely to assess the features of a particular junction phenotype.
Phenotypes not yet analysed could present additional possibilities to improve the Junction Mapper repertoire in future studies.
Junction Mapper analysis confirms mild phenotypes previously observed with manual, threshold-based quantifications of whole images (Erasmus et al., 2016), that indicate either an increase (EEF1A siRNA) or a decrease (CIP4 or VAV2 siRNA) in the intensity levels of E-cadherin. In addition, new Junction Mapper parameters uncover distinct features, that is that EEF1A depleted cells have higher E-cadherin occupancy and augmented cluster density when compared to controls. The profiling with new parameters underscores the potential of Junction Mapper to differentiate among distinct, subtle modes of junction perturbation. Yet, the conceptual significance of such alterations remains to be consolidated in future experiments and with additional biological replicates.
The plasticity of endothelial junctions is well established (Radeva and Waschke, 2018), but their unique responses to different stimuli have been challenging to quantify (Häring et al., 2018). The remarkable zig-zag pattern of thrombin-stimulated endothelial junctions correlates with increased vascular permeability (Malinova and Huveneers, 2018) but it is not recognized by the automated skeleton definition. Using area-based parameters, we find that the contacting interface is occupied more efficiently, with higher density of VE-cadherin receptors at endothelial junctions upon thrombin treatment. Thus, it seems that the increased levels of VE-cadherin at junctions may promote stronger endothelial adhesion, which is relevant to sustain elevated intracellular tension and contractility induced by thrombin stimulation. These results are consistent with the role of mechanical  20um 20um 20um 20um 20um 20um 20um 20um 20um 20um 20um 20um 20um 20um 20um 20um 20um 20um 20um 20um 20um  C D E F tension in receptor modulation and integrity of multicellular tissues (Liu et al., 2010), and merit further experimentation. Because of the fragmented and undulated nature of cardiomyocyte contacts (Ehler, 2016;Vermij et al., 2017), quantitative imaging tools specifically designed for intercalated discs have not been available or systematically used. At steady state, our data show that, in control cardiomyocytes, intercalated discs have clusters of cadherin receptors that are far apart. Hypertrophic stimulus in cellulo (neonatal rat cardiomyocytes) potently increases the levels of b-catenin at contacting interfaces, consistent with what was reported in hamster and human hypertrophic hearts (Masuelli et al., 2003). Connexin 43 is a major connexin isoform found in cardiomyocytes and its total protein and mRNA levels are augmented by hypertrophic signals in cellulo (i.e. phenylephrine) (Salameh et al., 2008;Stanbouly et al., 2008) or in human hearts with compensated left-ventricular hypertrophy by pressure-overloading (Kostin et al., 2004). The initial profiling analysis with Junction Mapper suggest that the formation of gap junctions is enhanced after hypertrophy stimulation in cellulo, confirming the broadening of intercalated disc area and higher number of GAP junctions in compensated hypertrophic hearts of human patients (Kostin et al., 2004). Although hypertrophic stimulus increases both b-catenin and connexin 43 levels at intercalated discs, these markers are regulated in distinct ways. The b-catenin cluster density is decreased leading to a more contiguous distribution, while connexin 43 is localised in clusters of higher density.
Clearly, further investigation is necessary to ascertain the profiling and biological significance of the phenotypes observed in different models. The quantification of very fragmented and zig-zagged junctions such as those in endothelia and cardiomyocytes is a challenge that Junction Mapper has begun to address, but improvements in future computation studies are welcomed. The complexity of these junctions also requires more user input to quality control the definition of the skeleton and corners. In addition, the ability of Junction Mapper to quantify junctions in a stratified epithelium, where the added complexity of multiple epithelial cell layers provides an additional challenge, remains to be tested.
We foresee the potential of Junction Mapper in distinct research areas, due to its innovative and in-depth approach to quantify cell-cell contacts. The detailed fine mapping of junction properties forms a basis to distinguish between disassembly mechanisms and infer cellular processes such as intracellular trafficking, receptor clustering or modulation of contraction at junctions. As multiple cellular processes contribute to junction stability, the fingerprinting of junction phenotypes after different stimuli is a powerful tool in pathway inference and guides rescue and translational experiments. Despite its limitations, Junction Mapper's broad dynamic range, repertoire of novel parameters and applicability to quantify junctions in various cell types will have a significant impact on studies in numerous model systems.

Source data
Numerical data used to prepare graphs in each figure. Data for each graph are listed in separate sheets in the Excel files. Explanations can be found in the first sheet of each Excel file.     Source data 1. Data obtained from cardiomyocyte experiments used in Figure 8 graphs.
A summary of the types of images used for different experiments, type of replicate and userdefined parameters is found in Supplementary file 1. Briefly, images were acquired on a Leica DM IRBE confocal (keratinocytes), Zeiss inverted LSM-780 (cardiomyocytes) or LSM-510 (keratinocytes) laser-scanning confocal (Carl Zeiss) using a 63x/1.4 Plan Apochromat objective or with an Olympus Provis BX51 microscope coupled to a SPOT RT monochrome camera using Simple PCI software (Hamamatsu, Japan; keratinocytes).

Software development
Junction Mapper is an open access, standalone and downloadable software developed in Java. The Junction Mapper code has been deposited in GitHub (license GNU GENERAL PUBLIC LICENSE; https://github.com/ImperialCollegeLondon/Junction_Mapper; copy archived at https://github.com/ elifesciences-publications/Junction_Mapper) and the software, instructions and its documentation can be downloaded from https://dataman.bioinformatics.ic.ac.uk/junction_mapper. The software uses algorithms that are mostly available open access, with some added innovation (i.e. fragmented length calculation). The novelty of Junction Mapper lays in the integration of distinct measurements, calculations of new parameters and consolidation of all parameters in a single system. In addition to junction measurements, we also developed a 'Nucleus Tool' to quantify the inter-nuclei distances of scattering epithelial cells -this tool will be described elsewhere.
The parameters and software to quantify junction phenotypes were built on the concept of our prior segmentation image analysis (Erasmus et al., 2016) based on intensity thresholding and whole image output obtained for the epithelial monolayer. Briefly, the labelling with a junctional marker (i.e. cadherin or a generic 'junction marker 1') is used to delineate the borders between cells and to form a mask to extract only the pixels found at contact sites for quantification. The mask can then be used to segment additional co-stained proteins that localise at junctions.
We address the bottlenecks in quantification of phenotypes that are not measurable by intensity only. Segmentation of images was performed to delineate where cell-cell contacts are (cell skeleton) and identify the corners between three or more contacting epithelial cells (see Figure 2-figure supplement 1 and 2). The cell skeleton is calculated in the following way. The original grey scale image of the 'junction marker 1' edges is interactively edited using blurring and sharpening filters to emboss the edges using the program GUI. The image is then binarized using an averaging filter (of the target pixel local neighbourhood) alongside a threshold and this binary image of cell edges is then super-imposed upon the original cell image stained for the junctional marker. Super-imposition of the skeleton and grey-scale image allows cell boundaries of each cell to be fine-tuned or re-  adjusted automatically using dilation, skeletonisation and maximum intensity within a neighbourhood algorithm. Edges can also be drawn on and removed from the image manually during this interactive process. The result is well-characterised edges that correspond to the real cell boundaries with a minimal amount of effort from the user. It has so far proved very hard to obtain reliable cell boundaries on a wide range of images and conditions without an interactive element. The program is designed to make this task as quick and efficient as possible. The image skeleton can then be dilated by the user (1 to 9 pixels, depending on image amplification and junction width) to set the area that fully contains the junctional marker staining. Corners between contacting cells are automatically identified and can be added or corrected manually. For junctions that are severely perturbed, providing a labelling for the whole cell facilitates the positioning of its corners and skeleton.
These spatial demarcations (skeleton, corners and area) are then used to calculate the primary parameters as described below ( Figure S2). A minimal threshold is applied to avoid losing any signal at the cell-cell interface. The length and area of (i) contacting membrane between cells (Interface Contour (unit pixels) and Interface area (unit pixels 2 ), respectively) was calculated using the skeleton between two neighbouring corners on the cell outline. The length and area of the specific staining of a junctional marker (Junction Contour (unit pixels) and Junction Area (unit pixels 2 ), respectively) were measured between the outermost above-threshold pixels of the staining observed along the contacting interface.
To evaluate distinct perturbations of junctions, primary parameters calculated the sum of the length of individual staining fragments of the junctional marker along the interface between cells (Fragmented Junction Contour, unit pixels). The Euclidian distance between corners was used to calculate the length of an optimal, straight interface between two cells (Straight-line Interface Length, unit pixels). For estimation of the optimal junction length, the parameter Straight-line Junction Length is derived from the Euclidian distance between the outermost above-threshold pixels of the staining of a junctional marker, which may or may not coincide with the distance between the corners. Additional primary parameters quantify more specifically the junctional marker: 'junction marker 1' Area (number of above the threshold pixels within dilated edge area, in pixels 2 ) and 'junction marker 1' Intensity (within the dilated edge area, in arbitrary units or A.U.).
Secondary parameters were derived to assess different phenotypes of perturbed contacts by normalizing measurements per length or area of each junction or contacting interface ( Figure S3). First, the software calculates how straight an interface or junction is using two parameters: (i) Interface Linearity Index (ratio between Interface Contour and Straight-line Interface Length, unitless) and (ii) Junctional Linearity index (ratio between Junction Contour and Straight-line Junction Length, unitless). Second, to estimate the proportion of the interface between cells that is covered by adhesion receptors, two parameters are calculated: (i) a length-based parameter, Coverage Index (ratio between Fragmented Junction Contour and Interface Contour, unit %) and (ii) an area-based parameter, Interface Occupancy (ratio between Junctional area and Interface area, unit %). The latter would be more appropriate to account for variable thickness of the junctional marker staining. Third, secondary parameters that address the specific distribution of junctional markers between neighbouring cells are: 'junction marker 1' intensity per interface area (ratio between 'junction marker 1' Intensity and Interface Area, unit A.U./pixel 2 ) and Cluster Density (ratio between 'junction marker 1' and Junction area, unit A.U./pixel 2 ).

Software validation
Validation of the length and area measurements of the interface, junctions and fragmented junctions was performed on selected junctions. The impact of user-controlled settings (dilation and thresholding) was tested by increasing the dilation or thresholding values during the analyses and comparing the effects on primary parameters of selected junctions. The coverage index was validated manually using FIJI and the active Rac1 expressing data set, on the same junctions quantified by Junction Mapper. The manual calculation (Lozano et al., 2008) has been traditionally done using the Euclidian distance (straight-line length) rather than the more precise contours measured by Junction Mapper. To estimate the impact of different users subjectivity on the data obtained with Junction Mapper, a random subset of images from three different data sets (siCIP4, H-Ras, endothelial cells) was analysed independently by a separate user without knowledge of the settings used for analysis by user A. Each user independently set up the corners, skeleton corrections, dilation and thresholding.
For estimation of signal to noise ratio required for the skeleton recognition by Junction Mapper, random noise was added to the original (high quality) image using Fiji (Gaussian (normally) distributed with a mean of zero and standard deviation of 25; https://imagejdocu.tudor.lu/gui/process/ noise) (Ferreira and Rasband, 2012). The quality of images was then estimated using the peak signal-to-noise ratio (PSNR) expressed in decibels (dB). The PSNR was calculated with the SNR Fiji plugin (Sage and Unser, 2003) by comparing original image to the images with added noise to the junction marker channel, since only this channel was used to create the skeleton. A heuristics approach on how to optimize analyses with Junction Mapper can be found in Supplementary file 4.

Image analysis -quality control and exclusions
Junction Mapper quantifies images in a variety of formats and resolutions. A summary of the image dataset and user-controlled values used in each experiment can be found in Supplementary file 1. Images obtained from different experiments were subjected to quality control before quantification: junctions were excluded if they have blurry areas, artefacts or large gaps between cells. Regions were also excluded that contained (i) junctions of cells overlapping or on top of each other (different focal plane) (ii) multinucleated cells (iii) cells that were not fully surrounded by neighbours (i.e. at the border of the image or epithelial colony), (iv) junctions of cells overexpressing high levels of protein.
As values are obtained per junction and a junction is shared by two cells, duplicated measurements of junctions are removed from the dataset.
For expression of different oncogenes, junctions were classified as those between (i) control cells (between two non-transfected cells), (ii) between two expressing cells (ee) or (iii) junctions shared by one expressing and a non-expressing cell (en). For the analyses of endothelial cells -junctions in blurry parts of the picture, with artefacts or large gaps between junctions and junctions at the border of a endothelial colony were excluded. For cardiomyocytes, the same criteria were applied as for endothelial cells and the parts of the image where the staining seemed very scattered and chaotic, with no clear trace of a junction were also excluded.

Statistical analysis
Normality test was performed in each dataset using Kolmogorov-Smirnov normality test and Shapiro-Wilk test. Data from Src Y527F , H-Ras G12V and Rac1 Q61L experiments were analysed using ANOVA with the Games-Howell post-hoc test from the 'userfriendlyscience' in RStudio. Despite the data being non-parametric, the large number of junctions in each sample (>100 junctions) allows for the use of ANOVA with Games-Howell post-hoc test, which corrects for unequal sample sizes and variances between groups and for data with non-parametric distribution. Significance was set at p<0.05. Data with a single treatment group and control group (this includes siRNA experiments in epithelial cells, cardiomyocytes and endothelial cells) were non-parametric and hence were analysed using the Mann-Whitney U-test in GraphPad PRISM. Pair-wise comparison was analysed with Wilcoxon matched paired test. The summary of the types of data used and statistical analyses can be found in the Supplementary files 1 and 4, respectively.
When biological replicates were analysed, it was first checked if the profile of the data was consistent across replicates, and then data was pooled. A total of 4080 junctions were quantified across different experiments (expression, siRNA or stimulus) and cell types using different batches of cells. An average of 227 junctions for each sample were analysed in parallel. The precise number of junctions quantified in each sample is written inside each graph. All numerical source data for each figure can be found in supplementary files online.
Graphs were obtained using GraphPad Prism. Images were processed using FIJI (Schindelin et al., 2012), Adobe Photoshop and Adobe Illustrator. Microscopy (FILM) at Imperial College London is part supported by funding from the Wellcome Trust (grant 104931/Z/14/Z) and BBSRC (grant BB/L015129/1). The funders had no role in study design, data collection and interpretation, or the decision to submit the work for publication. . Transparent reporting form

Data availability
The Junction Mapper code is licensed in github as GNU GENERAL PUBLIC LICENSE. The address is: https://github.com/ImperialCollegeLondon/Junction_Mapper (https://github.com/elifesciences-publications/Junction_Mapper). The software is downloadable as an executable jar file from https:// dataman.bioinformatics.ic.ac.uk/junction_mapper/. The image data used in this study has been previously published elsewhere (Erasmus et al., 2016;Huveneer et al., 2012) or are in preparation in separate mechanistic studies (Bruche et al., in preparation). Excel files of the output of parameters and calculations has been provided as source data files online.

Introduction
Junction Mapper is a semi-automated software application for analysing data from images of cells in close proximity to each other in monolayers. The software can be obtained as described below: . Downloadable as an executable jar format: https://dataman.bioinformatics.ic.ac.uk/junction_ mapper/ . Github address: https://github.com/ImperialCollegeLondon/Junction_Mapper (copy archived at https://github.com/elifesciences-publications/Junction_Mapper) . License: GNU GENERAL PUBLIC LICENSE The focus of Junction Mapper is to measure the morphology of cell boundaries, define single junctions and quantify the length, area and intensity of the staining of different proteins localised at cell-cell contacts. The output are various unique parameters that assess the contacting interface between cells and up to two junctional markers. Here we describe the operational mode of the software and how the different steps and parameters are calculated computationally.

Image Loading
Junction mapper is suitable for analysis of cell images that have the following properties: . The system will load single images; . several images can be opened in the program at the same time in individual analysis tabs . the tiff format is the most optimal highest image quality . The images can have up to three channels that correspond to the following features; Junction marker 1 -used to set up the cell boundaries and measurements Junction marker 2 -additional marker that can be measured. Cell nuclei (optional) Upon loading an image, the user is asked to define the channels in the tiff image where the three expected image analysis components are located (Junction 1 Channel, Junction 2 Channel and Nucleus). These can be defined in Junction Mapper for images stained with any combination of fluorescent conjugates. Users may add notes to their analysis in the text box below the channel dropdown menus. These will appear with output materials. operation can be performed on decreasing neighbourhood sizes in conjunction with the dilate and skeletonize functions to build a more accurate edge map. Edges can also be manually added or removed by the user by selecting the Add or Remove check buttons and clicking on the image itself. Click left to add a point and then click again to add a line between the points. This can be repeated to rapidly create an edge. Click with the righthand button to stop the edges being added. Some of the functions will only work when the binary image is displayed (dilate, local maxima). When the edge map corresponds to the edges of the cells in the image (cells to be measured) click the Finish button. Completed edge maps can be saved at this stage for future use (Save Edge Map).

Control name
Algorithm used Skeletonise Skeletonises image by using an adaption of the algorithm proposed in Arcelli et al. (1975).
The masks proposed in the paper are applied in (simulated) parallel fashion to image pixels until the resultant image reaches idempotence.

Local Maxima for Edges
Alongside dilation and erosion, this operation is used to align the single pixel-wide edges to the junction on the original grey scale image (junction marker 1) more closely. It uses the original grey scale image and the single pixel-width edge map as inputs.
The user is asked to select the neighbourhood size from the set: '5','7','9','11','15','21','25'} For each pixel in the binary edge map that is set to a 1, the neighbourhood around that pixel is inspected in the original grey scale edge junction marker one image. The location of pixel with maximum grey scale value in the neighbourhood of inspected pixel in junction marker one image is set to a '1' in the resultant binary image. It can be performed on gradually reducing neighbourhood sizes.
Edge Map Toggle Rotates the background image that the binary edge map image is projected onto. Either shows just a binary image, the Junction one channel or the Junction two channel. This control will rotate through the options in turn.
Add Straight Line A tool to draw straight lines on the edge map image using the mouse. Select by clicking the appropriate radio button and then click left mouse button on the image at the line start point and click again with the left button at the line end point. The line will be displayed on the image. Multiple straight lines can be added by multiple mouse clicks that uses the last point as the line start point. Edges can be traced quickly using this feature. Turn off the tool by clicking the right mouse button and move to a different location.
Remove Edge A tool to erase parts of the edge map using the mouse. Select the appropriate radio button on the interface and move the mouse over the edge fragments that are to be removed.

Reset
Returns to step 1 'Isolate edges' Step 4: Select cells to be analysed The cells to be analysed are selected in this stage by clicking inside the cell body (the edge map for each selected cells must have closed edges for this to work). Each cell is labelled with a random colour and a unique number (in this image). At this stage, a model is made of the cell and its contour by the software. When all the cells to be analysed have been identified the Finish button should be pressed. continued

Control name Algorithm used
Save spreadsheet Saves the junction parameters calculations in a spreadsheet for the selected cell along with corresponding reference images and a pdf document. The thresholded pixels outside the dilated area are also measured and recorded as Internal junction marker one area or Internal junction marker two area above the table of junction parameters in the spreadsheet.
Back to Cell State Returns to previous step so that another cell can be selected for measurement Return Returns to step 5 'Measure each cell' The image below shows the spreadsheet produced by the process described here. Both the Junction marker one image and Junction marker two images are analysed simultaneously. The parameters calculated for each cell-cell contact are defined in the next section.
Appendix 1-figure 10. Representative image of the output of Junction Mapper as an excel file.

Parameter Definitions and Formulae
This section defines the mathematical formulae to calculate the primary parameters for each edge identified in a cell. Secondary parameters are calculated by normalizing values with respect to the length or area of an interface or cell-cell contacts as outlined in the Suppl Figure 4. These measurements are output to the Excel spreadsheet as defined above.

# Name
Units Description Mathematical formula 1 Interface Contour [pixels] Distance between two corners of the defined cell edge L E ¼ P n i¼1 ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ðx i À x iþ1 Þ 2 þ ðy i À y iþ1 Þ 2 q Where L E is the interface contour length, p(x i ,y i ) is an edge pixel from an ordered list of edge pixels with cornerpix-el1(x 1 ,y 1 ) and cornerpixel2(x n+1 ,y n +1 ) continued # Name Units Description Mathematical formula 2 Straightline Interface Length [pixels] Straight line distance between two corner points L S ¼ ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi ðx 1 À x 2 Þ 2 þ ðy 1 À y 2 Þ 2 q L s is the straight-line interface length where p(x 1 ,y 1 ) is the first corner pixel on the cell edge p(x 2 ,y 2 ) is the last corner pixel on the cell edge 3 Fragmented Junction Contour [pixels] Sum of stained fragments along the single pixel edge L F ¼ P n j¼1 ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ðx j À x jþ1 Þ 2 þ ðy j À y jþ1 Þ 2 q Where L F is the fragmented junction contour length as the sum of the contour length of each junction fragment, p(x j ,y j ) is an edge pixel from an ordered list of edge pixels with p(x 1 ,y 1 ) being the first pixel on the cell edge fulfilling I(p(x j ,y j )) > Q I AND p(x n+1 ,y n+1 ) being the last pixel on the cell edge fulfilling I(p(x j ,y j )) > Q I , where Q I is the a priori defined intensity threshold, and I(p(x j ,y j )) being the intensity of a given pixel Fragments must be at least two pixels 4 Dilation Cycles [unitless] Number of cycles used to dilate the defined edge Number of times the binary image dilate algorithm is used to expand the defined edge. Essentially one dilation cycle changes a line of pixel width one to a line of pixel width 3. Two dilation cycles make the line five pixels-wide, etc.
5 Interface Area [pixels 2 ] Area in pixels of the dilated edge area between two corners Where A E is the interface area as the sum of pixel area A p of all pixels in the dilated edge area and where A p is the pixel area with A p = 1px*1px = 1px 2 and o is the number of pixels in the interface area 6 Junction marker 1 Area [pixels 2 ] Area covered by junction marker staining within the interface area Where A FT is the junction marker area as the sum of pixel area A P of all pixels fulfilling the conditions p(x k ,y k ) Є A E , AND I(p(x k ,y k )) > Q I and where A P is the pixel area with A P = 1px*1px = 1px 2 and m is the number of pixels in the fragmented interface area A FT Where, I FT is the junction marker intensity as the sum of intensities I k of all pixels fulfilling the conditions 1) p(x k ,y k ) Є A E , AND 2) I(p(x k ,y k )) > Q I with m being the number of pixels in the fragmented interface area A FT 8 Junction Contour [pixels] Sum of pixel distances between the first and last junction marker pixels along the interface contour ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ðx j À x jþ1 Þ 2 þ ðy j À y jþ1 Þ 2 q Where L J is the junction contour length and p(x j ,y j ) is an edge pixel from an ordered list of edge pixels with p(x 1 ,y 1 ) being the first pixel on the cell edge fulfilling I(p(x k ,y k )) > Q I AND p(x n+1 ,y n+1 ) being the last pixel on the cell edge fulfilling I(p(x k ,y k )) > Q I 9 Straight-line Junction Length [pixels] Euclidian distance from first to the last pixel of junction marker one on the interface contour L JS ¼ ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi ðx 1 À x 2 Þ 2 þ ðy 1 À y 2 Þ 2 q L JS is the straight-line junction length where p(x 1 ,y 1 ) is the first pixel on the edge fulfilling I(p(x 1 , y 1 )) > Q I and p(x 2 ,y 2 ) is the last pixel on the edge fulfilling I(p(x 2 ,y 2 ) > Q I Q I is the a priori defined intensity threshold, and I(p(x j ,y j )) being the intensity of a given pixel

Nucleus Tool
The nucleus tool allows users to count nucleus in an image and to measure the distance between them, which can be used to infer distance between neighbouring cells. This tool is useful as an indirect measurement of cell scattering. Three steps are performed via the Nucleus Tool tab and outlined below: .
Step 3: Measure Distance between Neighbouring Cells Step 1: Adaptive Thresholding The first step is to binarize the image via Apply Adaptive Threshold.
3 Fragmented Junction Contour [pixels] Sum of stained fragments along the single pixel edge Sum of pixel to pixel distance measured by Euclidian distance between neighbouring pixels along the defined cell edge where the staining intensity exceeds the threshold set. The distance in between individual fragments is NOT calculated. Isolated single above threshold pixels are not included in this measurement.
4 Dilation Cycles [unitless] Number of cycles used to dilate the defined edge Number of times the binary image dilate algorithm is used to expand the defined edge. Essentially one dilate cycle changes a single pixel line to a three pixels-wide line. Two dilation cycles make the line five pixels-wide, etc.

Interface Area
[pixels 2 ] Area in pixels of the dilated edge area between two corners Number of pixels within the dilated edge area defined by two consecutive corners. The dilated area is represented by the green area on the image. Pixels on the red line are also included in this area. Sum of junction marker 1 intensities in the interface area defined in 6. This measurement only applies to pixels in which marker intensity is above the selected threshold. Pixels below the threshold are set to zero.

Junction Contour
[pixels] Sum of pixel to pixel distances between the first and last cadherin (junctional protein) pixels along the interface contour Sum of pixel to pixel distance measured by Euclidian distance between junction marker 1 pixels along the interface contour defined in 1. Distance is measured between the first and last above-threshold pixel, but in between these points all pixels (above and below threshold) are considered; i.e. the distance in-between junction marker 1 fragments (gaps) is also included.
9 Straight-line Junction Length [pixels] Euclidian distance from first to the last pixel of junction marker 1 on the interface contour Euclidian distance between the first pixel of Junction marker 1 above threshold encountered along the interface contour defined in 1 and the last junction marker 1 pixel above threshold on the edge defined in 1.