MaGNet: A Network-Based Method for Quantitative Analysis of the Mammary Ductal Tree in Developing Female Mice

Branching is a fundamental morphogenic pattern found in life across plants and animals at the tissue and cellular level [1, 2]. In plants, branching occurs at the level of shoots and in the veins of leaves (alongside the branches from which the name of the structural pattern is derived) [3, 4]. In animals, branching morphogenesis occurs during the development of organs as varied as the kidney, liver, lung, pancreas, prostate as well as at the cellular level in the dendrites of neurons and in the antigen presenting dendritic cell of the innate immune system [5].

Unlike most other organs, the mammary gland in female mice undergoes the majority of its branching morphogenesis postnatally, driven by hormonal cues associated with puberty [6]. In mice, this pubertal transition—marked by a rise in circulating estrogen—typically occurs between 4 and 7 weeks of age and initiates the outgrowth and elongation of the mammary ductal tree [7]. Whole-mount imaging of mammary glands during this developmental window reveals striking structural changes, including expansion of the ductal epithelium throughout the fat pad and, in some models, the early emergence of malignant lesions [8,9,10,11]. Therefore, the quantifying of ductal branching initiation and elongation has emerged as a key approach for assessing how molecular or cellular perturbations influence mammary gland expansion across developmental stages [5, 12]. Despite its critical importance, the field still lacks a robust and widely adoptable method for quantifying mammary gland morphology that delivers consistent reproducibility across both normal development and neoplastic transformation studies.

Previous advances in network theory-based analysis of ductal branching morphogenesis have been largely built on entirely manual pipelines with custom made software or convoluted imaging modalities such as optical projection tomography scanning [5, 13,14,15,16], [16]. However, these approaches often lack open-source availability and typically require specialized expertise to operate. These limitations underscore the need for an accessible analysis pipeline that is scalable, user-friendly, reproducible, and easily adaptable, thus offering a practical alternative to closed, and technically demanding methods. Here, we present a method of Mammary Gland Network Analysis (MaGNet), a validated, user-friendly, and freely available method for the quantification of branching morphogenesis from 2D whole-mount mammary gland images, using a network theory–based computational approach.

The MaGNet method leverages the conceptual framework of network theory to quantitatively and systematically analyze the mammary ductal tree. Within this framework, networks represent the structural organization of the gland, where nodes correspond to branch points or terminal end buds (TEBs), and edges represent the ducts connecting them (Fig. 1). By abstracting the ductal architecture into a graph of undirected and unweighted edges, we simplify the analysis without compromising accuracy. While this model currently emphasizes macro-level branching dynamics, it is readily adaptable for future integration of edge directionality or weights—features that could capture physiological parameters such as nutrient flow, ductal thickness, or spatial-temporal remodeling (Fig. 2). This approach provides a powerful, flexible platform to interrogate mammary gland morphology across diverse developmental and disease contexts.

Fig. 1figure 1

Illustration of a mammary ductal tree network, and how it compares to a network schematic, with features such as nodes, edges, terminal nodes and degree noted

Fig. 2figure 2

Schematic overview of MaGNet analysis pipeline, beginning with brightfield image acquisition and manual tracing of the mammary ductal tree, followed by conversion of the traced structure into a NEFI-compatible format for downstream network analysis using NetworkX

To convert whole-mount mammary gland images into analyzable network graphs, we utilized the previously validated tool NEFI (Network Extraction From Images) [17]. This tool is particularly well-suited for the analysis of mammary gland whole mount, as its ductal architecture inherently forms a branching network. After tracing and extracting the network structure from the images, we processed the data using the Python-based NetworkX package [18]enabling high-throughput and customizable quantitative analyses (Fig. 3A–J). The resulting network models allow for automated computation of key architectural metrics, including total node and edge counts, node degree distributions, and the identification of terminal nodes (Fig. 4A–F). While the image tracing step currently involves manual user input, all downstream analyses are fully automated, thus supporting reproducibility, scalability, and broad applicability across experimental conditions.

Fig. 3figure 3

Processing from mammary gland whole mount images using MaGNet pipeline. A Acquisition of brightfield images of whole-mount staining. B Conversion to a tracing manually. C-H Conversion of the tracing into a NEFI object using segmentation (C), thinning (D), graph detection (E-F) and filtering (G-H). All NEFI steps are shown as a zoom-in for image clarity (D, F, H). I-L Analysis of the network graph using a NetworkX object. A representative NetworkX object is shown with its derived total ductal tree length (I-J), and ductal tree area (area within the network limits) (K-L). The functionalities to calculate ductal tree length and area are included in our open-source code

Fig. 4figure 4

Utilization of MaGNet for the quantification of whole-mount mammary gland images during pubertal development. A-C Representative whole-mount images at the three studied timepoints. D-F Quantification of the number of nodes (D), ductal branching tree (E), and terminal nodes (F), from mammary tissue obtained from female mice at 1 month old (n = 6), 1.5 months old (n = 4) and 2 months old (n = 4). G Quantification of the total tree length (mm) by Condition from 1 month (n = 4), 1.5 months (n = 4) and 2 months (n = 4) old female animals. H Quantification of area of convex hull (mm [2]) by Condition from 1 month (n = 4), 1.5 months (n = 4) and 2 months (n = 4) old female animals. I Quantification of percentage of branching nodes by degree and condition from 1 month (n = 6), 1.5 months (n = 4) and 2 months (n = 4) old female animals. n.s. = not statistically significant. J Quantification of branching degree distribution by condition from 1 month (n = 6), 1.5 months (n = 4) and 2 months (n = 4) old female animals. Total node number per each branching degree is shown

As a proof of principle, we applied the MaGNet analytical pipeline to analyze whole-mount mammary gland images from wild-type female mice at three closely spaced developmental stages, 1 month, 1.5 months, and 2 months of age, thus capturing the critical window of pubertal onset (Fig. 4A–C). These timepoints were strategically selected to test the sensitivity of our method in detecting rapid, hormone-driven changes in ductal morphogenesis. Our network-based quantification revealed statistically significant increases in key architectural features of the ductal tree, including a ~ 4-fold rise in the number of nodes (branch points/TEBs, 4.19-fold), edges (ducts, 4.23-fold), and terminal nodes (branches, 4.06-fold) in mammary glands from 1.5-month-old female mice compared to those at 1 month of age. These results demonstrate the MaGNet pipeline’s robustness in detecting short-term but significant morphogenic changes during this developmental window (Fig. 4D-H).

Comparative analysis of mammary ductal networks between 1.5- and 2-month-old female mice revealed modest but statistically significant differences in tissue architecture. Specifically, we observed a ~ 1.3-fold increase in nodes (branch points/TEBs), edges (ducts), and terminal nodes (branches) in the 2-month-old samples relative to 1.5-month-old counterparts (Fig. 4D–H). These findings indicate a developmental shift from rapid ductal expansion to structural refinement and maturation during late puberty, dynamics that were effectively captured by the quantification method offered by MaGNet.

The MaGNet quantification pipeline also facilitates high-resolution analysis of node degree distributions across diverse physiological and experimental contexts. In our developmental dataset, we observed a consistent pattern in which approximately 50% of branching nodes displayed either a degree of 1 (terminal) or 3 (bifurcation), independent of animal age. This finding underscores a stereotypical bifurcating architecture of the mammary ductal network during pubertal development (Fig. 4I). Nodes with a degree of 2, indicative of direction changes without branching, were rarely detected, suggesting that ductal outgrowth proceeds with high directional fidelity during this developmental window. Yet, the number of nodes with degree 1 (terminal) and degree 3 (bifurcation) rose markedly during the pubertal phase of mammary gland development, with a ~ 4-fold increase observed between 1- and 1.5-month-old mice, and a further 1-fold increase from 1.5 to 2 months (Fig. 4J). Collectively, these quantifications are consistent with known developmental dynamics of puberty and mammary gland morphogenesis [13]. Our observations demonstrate the MaGNet pipeline’s sensitivity in capturing both rapid ductal expansion during early puberty and the subsequent refinement phase characterized by more subtle remodeling of the mammary architecture.

To further demonstrate the versatility and sensitivity of the MaGNet pipeline across distinct developmental contexts, we also analyzed whole-mount mammary gland images from a previously published study in which nulliparous wild-type mice were treated with slow-release estrogen and progesterone pellets to mimic pregnancy-induced mammary gland development [8]. We specifically compared ductal tree architecture at 6- and 12-days following hormone exposure. MaGNet analysis of traced images revealed marked increases in key structural metrics, including a 1.6-fold rise in branch points (nodes), a 1.6-fold increase in ductal segments (edges), and a 1.6-fold elevation in terminal branches by day 12 compared to day 6 (Fig. 5A–C). These results highlight MaGNet’s capacity to capture hormone-driven morphogenic changes with high resolution, reinforcing its utility in quantifying dynamic remodeling of the mammary epithelium during simulated pregnancy.

Fig. 5figure 5

Utilization of MaGNet for the quantification of whole-mount mammary gland images during hormone-induced pseudo pregnancy. Quantification of the (A) number of nodes, (B) number of edges, and (C) number of terminal nodes from the ductal branching tree in the mammary tissue from female mice exposed to pregnancy hormones for 6 days (n = 3) or 12 days (n = 4)

To assess the methodological reproducibility and robustness of MaGNet, we compared quantifications across users and additional conventional methodologies. Analysis of inter-user quantification variability was evaluated by having three independent users manually trace three separate mammary gland samples (1-month-old), followed by automated network analysis. Although slight variations were observed, the quantification of terminal nodes identified across users were not statistically significant, suggesting consistency of the tracing quantification in a user-independent manner (Fig. 6A).

Fig. 6figure 6

Validation of MaGNet Analysis Pipeline Performance Through Comparison with Histological Quantification and Assessment of Inter-User Variability. A Quantification of terminal nodes tracing of the same whole-mount images by three independent users (n = 3 users, n = 3 stained glands each). Each color indicates a different user tracing the same image with lines connecting the different traces from the same image. B-C Representative H&E-stained tissue section (B) and whole-mount image (C) from a 1-month-old female mouse. D Quantification of mammary ductal tree via manual duct counts from H&E-stained tissue sections, compared to the network pipeline tracings of whole-mount staining from the same mouse (n = 5 for each modality from each mouse)

To further evaluate the performance of the MaGNet pipeline, we compared its network-based quantification outputs with conventional manual duct counts obtained from H&E-stained mammary tissue Sects. [19,20,21,22]. While the comparison did not yield statistically significant differences in absolute duct counts, MaGNet demonstrated greater sensitivity in detecting sample-to-sample variation. This suggests that MaGNet provides a more consistent assessment of ductal features that are often underrepresented or missed in manual quantification approaches (Fig. 6B-D). These findings underscore the utility of MaGNet in offering a more nuanced and scalable alternative to traditional histological analysis.

Overall, our analysis and conclusion support that the MaGNet pipeline offers a valuable and accessible resource for the mammary gland development research community. In addition to its robust mode of quantification, the MaGNet pipeline is fully available as an annotated Colab Notebook, which contains all necessary steps for conducting a mammary quantification network-based analysis. The code is modular and easily adaptable to accommodate user-specific datasets or experimental designs. While image tracing remains a technically demanding step and could be viewed as a current limitation of MaGNet, this platform establishes a foundational framework that is readily compatible with future integration of automated tracing tools. Such advancements are expected to significantly improve both the usability and reproducibility of the quantification workflow, further enhancing its value to the research community. Importantly, the MaGNet pipeline is compatible with the NetworkX Python package [18]enabling users to extend the analysis beyond basic metrics like nodes and edges to include advanced topological features such as centrality, clustering coefficients, and path lengths. These capabilities position the MaGNet pipeline as a scalable and customizable platform for quantitative analysis of mammary ductal architecture, while providing a robust and extensible alternative for whole mount mammary quantification.

Comments (0)

No login
gif