Characteristics of study population
Table 1 presents a summary of the demographic and clinical characteristics of the study population. The mean age at breast cancer diagnosis was 38.0 years in the NPBC group, 35.0 years in the PABC group, and 42.2 years in the PWBC group (p < 0.001). The age difference between groups was primarily attributable to the PWBC group, which was significantly older than both the NPBC (p = 0.04) and PABC (p < 0.001) groups in pairwise comparisons. However, no significant difference in patient age was observed between the NPBC and the PABC groups (p = 0.22). Regarding disease stage, 31 patients (29.5%) had stage I, 49 (46.7%) had stage II, and 35 (33.3%) had stage III breast cancer. Molecular subtyping by PAM50 classification revealed 12 basal-like, 25 HER2-enriched, 26 luminal B, and 42 luminal A tumors. No significant differences in disease stage (p = 0.156) or molecular subtype (p = 0.636) were observed among the NPBC, PABC, and PWBC groups.
Uniform manifold approximation and projection of immune cell profiles
Uniform manifold approximation and projection (UMAP) was employed to visualize differences in immune cell composition across the study groups based on data derived from both multiplex IHC and transcriptomic analyses. The immune cell distribution patterns in PABC cases closely resembled those observed in the PWBC group (p = 0.261, Fig. 1A). However, significant differences were observed between the PABC and NPBC groups (p = 0.003) and between the PWBC and NPBC groups (p = 0.006). UMAP analysis stratified by PAM50 molecular subtypes revealed no evident differences in immune cell distribution, except for a significant distinction between the luminal A and basal-like subtypes (p = 0.006, Fig. 1B). Further subgroup analysis of immune cell composition within each molecular subtype revealed a significant difference between the PABC and NPBC groups within the luminal A subtype (Supplementary Fig. 1). These findings suggest that pregnancy or lactation may modulate the tumor immune microenvironment, particularly in the luminal A subtype of breast cancer.
Uniform manifold approximation and projection (UMAP) of immune cell profiles on basis of multiplex IHC and transcriptomic data. Grouped by (A) NPBC, PABC, and PWBC, and (B) PAM50 subtyping
Immune scores of breast tumors by pregnancy subgroups
Multiplex IHC staining revealed significant differences in Opal immune scores across the NPBC, PABC, and PWBC groups (p < 0.001, Fig. 2A). Across all molecular subtypes, tumors in the PABC group had the highest immune scores. In contrast, those in the NPBC group had the lowest. The immune scores were significantly higher in the PABC (p < 0.001) and PWBC (p = 0.003) groups than in the NPBC group. A subtype-specific analysis further indicated that PABC tumors were associated with significantly higher immune scores than NPBC tumors were in the luminal A (p = 0.019) and HER2-enriched (p = 0.044, Fig. 2A) subtypes. However, the difference in immune scores between the PWBC and NPBC groups did not reach statistical significance in the subtype-specific analysis, a finding potentially attributed to the limited sample size.

Comparisons of immune scores among subgroups in (A) multiplex IHC and (B) transcriptome analyses. * p < 0.05, ** p < 0.01, *** p < 0.001, ns non-significant, group difference accessed with Kruskal-Wallis test
In the transcriptomic analysis, BC360 immune scores significantly differed among the NPBC, PABC, and PWBC groups (p < 0.001, Fig. 2B). Across all molecular subtypes, tumors in the PABC group exhibited the highest immune scores. In contrast, those in the NPBC group had the lowest. The BC360 immune scores were significantly higher in the PABC (p = 0.011) and PWBC (p = 0.002) groups than in the NPBC group. The subtype-specific analysis further revealed that PABC tumors were associated with significantly higher BC360 immune scores than NPBC tumors were in the luminal A subtype (p = 0.001). Additionally, PWBC tumors were associated with significantly higher BC360 immune scores than NPBC tumors were in the luminal B subtype (p = 0.033).
Immune cell composition of breast tumors by pregnancy subgroups
Multiplex IHC analysis revealed that compared with the NPBC subgroup, the PABC subgroup exhibited significantly higher densities of CD4+ T cells, CD8+ T cells, CD20+ B cells, and CD68+/CD163+ M2 cells (Fig. 3A–C, E). The CD20+ B cells density was greater in PABC than PWBC. By contrast, the density of CD68+ cells did not significantly differ among the three subgroups (Fig. 3D). The subtype-specific analysis further revealed that compared with NPBC tumors, PABC tumors exhibited increased densities of CD4⁺, CD8⁺, CD20⁺, and CD68⁺/CD163⁺ macrophages in the luminal A subtype; increased densities of CD68⁺/CD163⁺ macrophages in the luminal B subtype; and increased densities of CD8⁺ T cells and CD20⁺ B cells in the HER2-enriched subtype (Supplementary Fig. 2). Additionally, tumors from the PWBC subgroup exhibited higher densities of CD20⁺ B cells and CD68⁺/CD163⁺ macrophages in patients with the luminal A subtype and elevated CD4⁺ T cell densities in patients with the luminal B subtype compared with NPBC tumors (Supplementary Fig. 2). In the luminal B subtype, the density of CD68⁺/CD163⁺ M2 macrophages was higher in PABC compared to PWBC. The spatial colocalization of immune cells and tumor cells is presented in Supplementary Fig. 3. No significant differences in NSInC indices were observed among the NPBC, PABC, and PWBC groups, suggesting that immune–tumor cell colocalization is not influenced by pregnancy status.

Multiplex IHC immune cell of densities of (A) CD4 + T cells, (B) CD8 + T cells, (C) CD20 + B cells, (D) CD68 + cell and (E) CD68+/CD163 + M2 cells. * p < 0.05, ** p < 0.01, *** p < 0.001, ns non-significant, group difference accessed with Kruskal-Wallis test
Immune cell signatures derived from the BC360 transcriptomic analysis revealed that the PABC subgroup exhibited higher signatures for macrophages, cytotoxic cells, CD8 T cells, and B cells compared with the NPBC subgroup (Fig. 4A, Supplementary Table 1). Additionally, the PWBC subgroup exhibited higher signatures for cytotoxic cells, CD8 T cells, B cells, exhausted CD8 T cells, macrophages, and regulatory T cells relative to the NPBC subgroup (Fig. 4B, Supplementary Table 1). The macrophage signature was statistically higher in PABC than PWBC (Supplementary Table 1). A transcriptomic analysis stratified by molecular subtype further revealed that compared with the NPBC subgroup, the PABC subgroup exhibited higher signatures for B cells, CD8 T cells, cytotoxic cells, macrophages, and mast cells in the luminal A subtype and a higher macrophage signature in the luminal B and HER2-enriched subtypes. Additionally, compared with the NPBC subgroup, the PWBC subgroup exhibited higher signatures for cytotoxic cells, macrophages, exhausted CD8 T cells, CD8 T cells, and B cells in the luminal B subtype as well as for regulatory T cells, macrophages, and B cells in the HER2-enriched subtype (Supplementary Fig. 4, Supplementary Table 2). The macrophage and mast cell signatures were statistically higher in PABC than PWBC in luminal A subtype (Supplementary Table 2).

Transcriptomic immune cell signature difference between (A) PABC and NPBC, and between (B) PWBC and NPBC subgroups. Dotted line indicates p value = 0.05
Collectively, the findings from the multiplex IHC and transcriptomic analyses indicated a significant increase in B cells, CD8 T cells, and macrophages in the PABC subgroup compared with the NPBC subgroup.
Validation of immune cell composition by pregnancy subgroup using GEO datasets
A comprehensive search of the GEO database for human expression array data was conducted using the keywords “breast cancer” and “pregnancy,” yielding 22 datasets. After a review of the dataset descriptions, the datasets of 10 studies were excluded because of an absence of pregnancy status information, along with other 3 studies on normal breast tissue, 2 involving cell lines, 1 on post-radiational angiosarcoma, and 1 on ulcerative colitis that contained a duplicated dataset. Additionally, a duplicate entry was identified between dataset GDS4766 and series GSE31192. Three datasets—GSE31192, GSE53031, and GSE112825—were selected for validation. Datasets GSE31192 and GSE112825 were analyzed using the Affymetrix Human Genome U133 Plus 2.0 Array, whereas the GSE53031 dataset was analyzed using the Affymetrix Human Genome U219 Array. In the GSE31192 dataset, PABC was defined as breast cancer diagnosed during pregnancy or within 1 year postpartum, whereas nulliparous women or patients with breast cancer diagnosed 5 years postpartum were categorized into the NPBC group. Only tumor tissue data were included in this validation analysis. Breast cancer cases diagnosed during pregnancy were categorized as PABC, and two age-matched controls were selected for each PABC case from the GSE53031 dataset. Dataset GSE112825 provided the time interval between breast cancer diagnosis and pregnancy, with a 5-year threshold applied to designate PABC status. In total, 93 PABC and 143 NPBC cases were included in the validation cohort. Molecular subtyping revealed a slightly higher proportion of basal-like subtype tumors in the PABC group (Supplementary Table 3).
CIBERSORT analysis demonstrated significantly higher absolute immune scores in patients with PABC than in those with NPBC (p < 0.001, Fig. 5A). The difference could also be found in luminal A, luminal B and basal-like subtypes (Supplementary Fig. 5). Immune cell profiling further revealed that PABC was associated with increased signatures for gamma-delta T cells, M0 macrophages, and resting dendritic cells, whereas signatures for regulatory T cells, monocytes, neutrophils, and activated natural killer cells were decreased (Fig. 5B). The subtype-specific analysis was shown in supplementary Fig. 6. These findings are consistent with results from our study, which indicate that immune cell aggregation occurs during pregnancy but the adaptation of immune cell subsets varies across molecular subtypes.

CIBERSORT imputation result of external gene expression datasets in (A) immune score and (B) immune cell signatures. *** p < 0.001, group difference accessed with Wilcoxon rank sum test
Survival impact of tumor immune microenvironment across pregnancy subgroups
The five-year recurrence-free survival (RFS) rate in our cohort was 90.4%. No significant RFS differences were observed among patients with NPBC, PABC, or PWBC (p = 0.82; Supplementary Fig. 7A). To assess the prognostic relevance of the immune microenvironment, patients were stratified into high and low immune activity groups based on the median values of immune scores, cell densities, or cell-specific transcriptomic signatures. Log-rank tests showed no significant differences in RFS between patients with high vs. low Opal immune scores (p = 0.95) or BC360 immune scores (p = 0.50; Supplementary Fig. 7B & C). Univariate Cox regression analyses further confirmed that neither IHC-defined immune cell populations nor transcriptomic immune cell signatures were significantly associated with RFS (Supplementary Table 4).
To investigate the impact of immune cell-tumor colocalization, patients with positive NSInC index were compared to those with zero or negative NSInC index. While not reaching statistical significance, higher colocalization between CD4 + or CD8 + T cells and tumor cells showed trends toward improved RFS (p = 0.064 and p = 0.071, respectively; Supplementary Table 5).