Introduction

Palliative systemic therapy is a primary treatment option in patients with metastatic gastric cancer (MGC) to alleviate disease-related symptoms and improve survival1,2. However, the prognosis of MGC is still very poor, with a survival of < 2 years1,2. Recently, immune checkpoint inhibitors (ICIs), such as anti-programmed cell death 1 (PD-1) and anti-programmed death-ligand 1 (PD-L1), have revolutionized the systemic treatment paradigm in many advanced solid tumors3. Anti-PD-1 antibodies, such as nivolumab and pembrolizumab, have significant benefits and offer new treatment options in patients with previously treated MGC4,5,6. However, the overall response rate for anti-PD-1 antibodies in patients with previously treated MGC is low (5–25%), and most patients do not respond to these ICIs4,5,6. Although no definite predictive biomarkers of anti-PD-1 or PD-L1 antibodies are available, PD-L1 expression, DNA mismatch repair (MMR), and Epstein-Barr virus (EBV) status have been proposed as predictive biomarkers of the ICI response in MGC patients7. Moreover, high tumor-infiltrating lymphocyte (TIL) levels have been reported as a favorable prognostic biomarker and significant predictor of immunotherapy8,9,10.

Anti-PD-1 treatment is a systemic therapy for metastatic disease in patients with MGC who have previously received cytotoxic or molecularly targeted agents. A comprehensive evaluation of immune-related biomarkers in metastatic tumors is needed before starting anti-PD-1 treatment. However, re-biopsy of a metastatic lesion is not always feasible in clinical practice and could result in unpleasant complications due to invasive procedures. Therefore, the assessment of immune-related biomarkers for MGC was based on the tumor immune microenvironment (TIME) of primary gastric cancer (PGC) specimens obtained during curative resected gastrectomy before recurrence, or PGC specimens acquired at the time of initial diagnosis before palliative systemic therapy. Since the TIME of metastatic tumors may differ from that of primary tumors due to intratumoral (IT) or inter-tumoral molecular heterogeneity, immune escape during metastasis or disease progression, and systemic effects of previous therapy, PGC specimens may not accurately reflect the TIME of MGC. However, no previous report has evaluated immune-related biomarkers in MGC specimens.

In this study, we compared the TIMEs of primary and paired metastatic gastric cancer, including T-cell density, PD-L1 expression, MMR status, EBV positivity, and immune-related gene expression. We also evaluated the prognostic impact of tumor-infiltrating T cells in primary and metastatic tumors in gastric cancer patients.

Results

Clinicopathological characteristics

We screened a pathological database for 120 patients with pathologically confirmed gastric adenocarcinoma in primary lesions and corresponding metastatic lesions between January 2009 and May 2019. Of these patients, 23 patients who underwent surgical treatment for PGC and MGC were enrolled in this analysis (Supplementary Fig. 1). The clinicopathological characteristics of the patients are presented in Table 1. Surgically resected metastatic sites were the liver (n = 6, 26.1%), abdominal wall or skin (n = 5, 21.7%), ovary (n = 4, 17.4%), and other various metastatic sites, including gallbladder, lung, distant lymph node, bone, peritoneum, or appendix (n = 8, 34.8%). Of the 23 patients, only 7 patients (30.4%) had stage IV disease at initial diagnosis of gastric cancer and received simultaneous resection including gastrectomy and MGC resection. Sixteen patients (69.6%) had metachronous metastasis and receive staged resection including gastrectomy and MGC resection at 6 months or more after gastrectomy. The median disease-free survival of these 16 patients was 21.0 months and the duration between gastrectomy and MGC resection was 23.1 months. Further, 5 of these 16 patients received systemic chemotherapy before MGC resection.

Table 1 Clinicopathological characteristics.

A comparison of PD-L1 positivity, MMR status, and EBV positivity between PGC and MGC is shown in Table 2. Using a 1% cut-off value for combined positive score (CPS), PD-L1 positivity was observed in 52.2% (12/23) of PGC cases and 4.3% (1/23) of MGC cases. Deficient MMR (dMMR) was detected more frequently in PGC (8.7%, 2/23) than paired MGC (4.3%, 1/23). One of the patients had PGC with dMMR and a synchronous skin metastatic tumor with proficient MMR (pMMR) (Supplementary Fig. 2). EBV was not detected in 46 PGC and MGC specimens from 23 patients.

Table 2 Concordance of PD-L1 positivity, MMR status, and EBV positivity between PGC and MGC.

Comparison of T-cell density and PD-L1 expression between PGC and MGC

T-cell density and PD-L1 expression in PGC and MGC are shown in Supplementary Table 1. CD4+ T-cell density in the IT and invasive margin (IM) regions was lower in MGC (44.5 ± 71.0 cells/field) than in PGC (62.2 ± 60.2 cells/field), but the difference was not significant (P = 0.200; Fig. 1a). CD8+ T-cell density in the IT and IM regions was significantly lower in MGC (35.5 ± 52.8 cells/field) than in PGC (79.6 ± 73.1 cells/field; P = 0.046; Fig. 1a), as was PD-L1+ cell density (6.2 ± 18.6 cells/field vs. 77.5 ± 154.0 cells/field; P = 0.010; Fig. 1b). PD-L1+CK+ cell density in the IT and IM regions was also significantly lower in MGC (4.5 ± 13.3 cells/field) than in PGC (58.8 ± 114.7 cells/field; P = 0.001; Fig. 1b). The lower T-cell density and PD-L1 expression in the IT and IM regions in MGC was observed regardless of the duration between gastrectomy and MGC resection (Fig. 1c) or systemic therapy initiation before MGC resection (Fig. 1d). In the three regions including peritumoral stromal (PS), T-cell density and PD-L1 expression exhibited similar trends as T-cell density and PD-L1 expression in the IT and IM regions (Supplementary Table 1).

Figure 1
figure 1

Tumor-infiltrating T-cell density and PD-L1 expression in PGC and MGC. (a) Comparison of CD4+ and CD8+ T-cell density in the IT and IM regions. (b) Comparison of PD-L1+ and PD-L1+CK+ cell density in the IT and IM regions. (c) T-cell density and PD-L1 expression in the IT and IM regions analyzed according to the duration between gastrectomy and MGC resection and (d) whether patients received systemic therapy before MGC resection. (e) CD4+ and CD8+ T-cell density and (f) PD-L1+ and PD-L1+CK+ cell density according to tumor region. PGC primary gastric cancer, MGC metastatic gastric cancer, IT intratumoral, IM invasive margin, PD-L1 programmed death-ligand 1, CK cytokeratin. Statistical analyses were performed using the Wilcoxon signed rank test (ns not significant; *P < 0.05; **P < 0.01; ***P < 0.001).

A regional comparison for each tumor showed that CD4+ and CD8+ T-cell density were higher in the IM regions than in the IT and PS regions (P = 0.016 for CD8+ T-cell density in PGC, and P = 0.008 for CD4+ T-cell density in MGC; Fig. 1e). PD-L1 expression tended to be higher in the IT regions than the IM and PS regions, though the difference was not significant in PGC and MGC (Fig. 1f).

Comparison of TIME types between PGC and MGC

PGC and MGC specimens were categorized into three types based on CD8+ T-cell density and distribution within the tumor microenvironment (Supplementary Table 2, Fig. 2a)11. Inflamed type was observed in 34.8% (Fig. 2b) and 26.1%, immune excluded type in 30.4% and 8.7%, and immune desert type in 34.8% and 65.2% (Fig. 2c) of PGC and paired MGC specimens, respectively.

Figure 2
figure 2

Comparison of tumor immune microenvironment types between PGC and MGC. (a) Comparison of types based on CD8+ T-cell density and the distribution between PGC and MGC. (b) Representative multiplex IHC images of a PGC specimen with inflamed type (high CD8+ T-cell density in the IT region). (c) Representative multiplex IHC images of paired MGC specimens with immune desert type (low CD8+ T-cell density in the IT, IM, and PS regions). (d) Comparison of types based on T-cell density and PD-L1 expression in the IT and IM regions between PGC and MGC. (e) Representative multiplex IHC images of PGC specimens with adaptive immune resistance type (high CD4+ + CD8+ T-cell density and PD-L1-positive). (f) Representative multiplex IHC images of paired MGC specimens with immunological ignorance type (low CD4+ + CD8+ T-cell density and PD-L1-negative). PGC primary gastric cancer, MGC metastatic gastric cancer, IHC immunohistochemistry, IT intratumoral, IM invasive margin, PS peritumoral stroma, PD-L1 programmed death-ligand 1, CK cytokeratin.

PGC and MGC specimens were also classified into four types based on the TIL density and PD-L1 expression: type I–adaptive immune resistance, type II–immunological ignorance, type III–intrinsic induction, and type IV–immune tolerance (Supplementary Table 2, Fig. 2d)12. PGC specimens had a higher proportion (34.8%) of type I than other subtypes (Fig. 2e). In the paired MGC specimens, we found no type I cases and a higher proportion of type II (73.9%) compared to the other subtypes (Fig. 2f).

Comparison of immune-related gene expression

RNA sequencing revealed that a total of 76 genes were significantly up-regulated and 443 genes significantly down-regulated in MGC compared to PGC (Fig. 3a). The immune-related genes that were down-regulated in MGC compared to PGC included several genes associated with the innate immune response (i.e., TRIM8, CTSG, CCL11, LILRB2, and EIF1AK2), immunoglobulin structure (i.e., JCHAIN), and T-cell activation (i.e., TYK2, IL16, HLA-DQA1, CXCL14, TNFSF15, and IL7R). Gene Ontology term analysis revealed that T-cell activation-related genes involved in calcineurin-nuclear factor of activated T cells (NFAT) and mitogen-activated protein kinase (MAPK) signaling cascades were down-regulated in MGC compared to PGC (Fig. 3b). Gene Set Validation Analysis (GSVA) for T-cell activation-related gene sets showed that the co-stimulatory molecule gene module decreased in MGC compared to PGC (Fig. 3c). Next, we performed Gene Set Enrichment Analysis (GSEA) using 18-gene T-cell inflamed gene expression profile (GEP) to predict responses to PD-1 blockade13,14 and found that the T-cell inflamed GEP decreased in MGC compared to PGC (Fig. 3d).

Figure 3
figure 3

Immune-related gene expression profiles. (a) Heat map of 519 differentially expressed genes (DEGs; P < 0.05 and fold change > 2). (b) Gene ontology analysis of the DEGs. (c) Gene Set Validation Analysis to assess the enrichment of gene sets related to immune checkpoints, immune checkpoint ligands, co-stimulatory molecules, co-stimulatory ligands, and chemokines. (d) Gene Set Enrichment Analysis to assess the enrichment of 18-gene T-cell inflamed gene expression profiles. PGC primary gastric cancer, MGC metastatic gastric cancer, NSE normalized enrichment score, GEP gene expression profile.

Prognostic impact on overall survival

The median overall survival (OS) for all patients was 16.9 months (95% CI 10.5–23.2 months). Univariable and multivariable analyses for OS according to clinicopathological characteristics and tumor-infiltrating T-cell infiltration are summarized in Table 3. We grouped the patients into low and high T-cell density by the median number of CD8+ T cells per field (50.9 cells/field) and the number of CD4+ and CD8+ T cells per field (111.4 cells/field) in the IT and IM regions of PGC and MGC. Univariate analysis revealed that an absence of peritoneal metastasis (P = 0.073), high CD4+ + CD8+ T-cell density in PGC (P = 0.092), and high CD8+ T-cell density in PGC (P = 0.068) exhibited a trend towards improved OS, though the differences were not significant. We calculated the total CD8+ T-cell density by summing CD8+ T-cell densities from PGC and MGC tumors for each patient. The median OS was significantly longer in patients with high CD8+ T-cell density than patients with low CD8+ TIL density (27.3 vs. 12.0 months, respectively, P = 0.002; Fig. 4). Multivariable analysis included variables that tended to associate with survival (P < 0.1), and revealed that only the total CD8+ T-cell density was an independent prognostic factor for both PGC and MGC tumors (hazard ratio [HR] 0.188, 95% confidence interval [CI] 0.057–0.624, P = 0.006; Table 3).

Table 3 Univariable and multivariable analyses of overall survival.
Figure 4
figure 4

Overall survival according to total CD8+ T-cell density in PGC and MGC. PGC primary gastric cancer, MGC metastatic gastric cancer, OS overall survival. Statistical analysis was performed using the Kaplan–Meier method.

Discussion

To the best of our knowledge, this study is the first to evaluate TIME differences between primary and pair-matched metastatic tumors in gastric cancer. We found that, in gastric cancer patients, immune-related biomarkers, such as T-cell density, dMMR status, PD-L1 expression, and the T-cell activation-related gene signature, were significantly lower in metastatic tumors than in primary tumors. Furthermore, a high CD8+ T-cell density of primary and metastatic tumors was associated with improved survival in MGC patients.

Many previous studies have reported discrepancies in T-cell infiltration and PD-L1 expression between primary and metastatic lesions in other solid tumors15,16,17,18,19,20. In our study, PGC has higher T-cell density, particularly CD8+ T cells and PD-L1 expression, than MGC. These differences between primary and metastatic tumors can be due to many factors, including the immune escape mechanisms of the metastatic tumor itself, time interval between primary and metastatic cancer tissue acquisition, and previous systemic therapy. However, according to our subgroup analysis, the T-cell density and PD-L1 expression were lower in MGC than PGC, regardless of the timing of MGC resection or systemic therapy before MGC resection. Therefore, the difference in TIME may be attributed to the immune escape mechanism of metastatic tumors and the selection pressure during disease progression or previous therapy.

In recent years, several classifications have been used to evaluate immunological status and predict anti-tumor responses to ICIs11,12. In our study, PGC specimens had almost equal proportions of inflamed (34.8%), excluded (30.4%), and immune desert (34.8%) types, whereas two-thirds (65.2%) of the MGC specimens were composed of the immune desert type. Moreover, the PGC specimens had a higher adaptive immune resistance type (34.8%) than other subtypes, and MGC specimens were almost all immunological ignorance type (73.9%). Two mechanisms underlying PD-L1 upregulation have been proposed: an intrinsic oncogenic activation mechanism, and an extrinsic adaptive immune-induced PD-L1 upregulation secondary to interferon-γ secreted by TILs12,21. As most gastric cancers are associated with inflammation22, PD-L1 expression in PGC could be upregulated by an extrinsic adaptive immune response. This supposition is supported by previous studies showing that PD-L1 upregulation may be feedback from active immune reactions rather than a result of neoantigen expression in gastric and colorectal cancer23,24,25. However, our results demonstrate that the T-cell density was lower in MGC than PGC, and PD-L1 expression was nearly absent in MGC. Therefore, in MGC, lymphocyte infiltration induced by inflammation, as observed in PGC, is very rare, and little PD-L1 expression occurs from extrinsic adaptive immune reactions, resulting in immune desert and immune ignorant types.

An improved understanding of the TIME in MGC and PGC may be useful for designing immunotherapy strategies to improve treatment outcomes in MGC patients. Adaptive immune resistance type (high TIL density and PD-L1-positive) will most likely benefit from anti-PD-1 or PD-L1 treatment, whereas a single-agent anti-PD-1 or PD-L1 regimen would most likely not be successful in immunological ignorance type (low TIL density and PD-L1-negative)12. dMMR/high microsatellite instability or high T-cell inflamed GEP predict an objective and durable response to anti-PD-1 or PD-L1 antibody across multiple solid tumors7,13,14,26,27. In our study, MGC exhibited lower T-cell density, PD-L1 expression, dMMR, and T-cell inflamed GEP than PGC. Therefore, the low response rate of anti-PD-1 in the previous clinical trials of MGC patients, despite PD-L1-positive tumor in archival PGC tissues, may be due in part to these TIME differences between PGC and MGC. Furthermore, the T-cell density was lower in the IT region than the IM regions in both PGC and MGC, as indicated by the influence of immunosuppressive stroma, myeloid-derived suppressor cells, and angiogenesis, which prevent T-cell infiltration into the tumors and suppress T-cell activation. Therefore, combination strategies with immunotherapy other than anti-PD-1/anti-PD-L1 or chemotherapy and molecular targeted therapy may induce lymphocyte infiltration and be effective in MGC patients. Recent studies have reported that combining anti-PD-1 with other therapies, such as ipilimumab, chemotherapy, or ramucirumab has a higher response rate in MGC patients than anti-PD-1 alone28,29,30,31.

Many studies have reported that TILs are associated with a favorable outcome in numerous types of solid tumors8,9,10. In particular, high TILs, mainly CD8+ T cells, may be a potential prognostic biomarker in patients with gastric cancer8,24,25. Although it is difficult to compare the prognostic impact of CD8+ T-cell density between PGC and MGC because only five patients had MGC with high CD8+ T-cell density, the total CD8+ T-cell density in both PGC and MGC predicted the prognosis more accurately than the CD8+ T-cell density in PGC alone. Previous studies have reported that TIL density in distant metastatic lesions could be a prognostic biomarker17,32. Therefore, the TIME of metastatic tumors should be considered an important prognostic parameter for predicting prognosis in MGC patients.

The present study has some limitations. First, this study was a retrospective analysis with a limited number of paired PGC and MGC specimens. It is difficult to obtain tumor specimens from the metastatic site in MGC patients. Most previous studies comparing T-cell infiltration or PD-L1 expression between primary and metastatic tumors were performed in colorectal cancer or renal cell carcinoma23,32, in which metastasectomy is the standard treatment to improve survival, or in breast or non-small cell lung cancer, for which re-biopsy is recommended in clinical practice to inform the palliative systemic therapy regimen15,17,19. However, surgical resection or re-biopsy at metastatic lesions is rarely performed in routine practice in MGC patients. Our study only included surgically resected tumor tissues to perform an accurate and comprehensive comparison of the TIMEs in PGC and MGC. Therefore, our results are meaningful, even though the sample number is small. Second, we could not evaluate detailed immune cell subsets, differentiation, or exhaustion status of TILs. Therefore, additional studies detailing differences in the TIME between primary and metastatic tumors using flow cytometry analysis and fresh tissue specimens or high-fidelity techniques, such as mass cytometry and single-cell RNA sequencing, are required. Third, we could not evaluate the correlation between the distinct TIMEs in primary and metastatic lesions and tumor response to immunotherapy, which is the rationale for evaluating TIME. However, it has recently been shown that immune heterogeneity may contribute to the different tumor responses to anti-PD-1 treatment in multifocal hepatocellular carcinoma33. Therefore, further studies are needed in the future to determine the association between TIME heterogeneity and immunotherapy treatment outcomes.

In conclusion, we suggest that the TIME of metastatic tumors is less immunologically active than that of primary tumors in MGC patients. Therefore, an evaluation of immune-related biomarkers in metastatic tumors, as well as primary tumors, should be considered when assessing the TIME in MGC patients.

Methods

Patients and tumor samples

Cases were reviewed using a database of patients pathologically confirmed to have primary and metastatic gastric adenocarcinoma at Chungbuk National University Hospital between January 2009 and May 2019. We collected surgically resected formalin-fixed paraffin-embedded (FFPE) tissue samples to comprehensively and accurately assess the TIME around the tumor. Two experienced pathologists evaluated hematoxylin and eosin-stained slides from each FFPE block and selected the slide with the largest viable tumor cell area. Clinicopathological data, including age, sex, timing of metastatic disease, number of metastatic sites, presence of peritoneal metastasis, palliative systemic therapy, PGC location, and World Health Organization histological classification, were obtained from medical records and pathology reports. The study protocol was in line with ethical guidelines of the 1975 Declaration of Helsinki. This study was reviewed and approved by the Institutional Review Board (IRB) of Chungbuk National University Hospital (CBNUH 2018-10-007), and the IRB waived the requirement to obtain written informed consent from the patients.

Multiplex immunohistochemical staining protocol

T-cell density and PD-L1 expression were evaluated by multiplex immunohistochemistry (IHC) using the OPAL multiplex IHC kit (Perkin-Elmer, Waltham, MA) with a panel consisting of T-cell markers (CD4 and CD8), an immune checkpoint molecule (PD-L1), tumor cell marker (cytokeratin [CK]), and 4′,6-diamidino-2-phenylindole (DAPI) for nuclear DNA. The FFPE tissue sections (4-μm-thick) were heated for at least 1 h in a dry oven at 60 °C and dewaxed using xylene. The sections were then stained using a Leica Bond Rx Automated Stainer (Leica Biosystems, Newcastle, UK). The slides were baked for 30 min and dewaxed with Leica Bond Dewax solution (#AR9222, Leica Biosystems). Antigen retrieval was performed using Bond Epitope Retrieval 2 pH 9.0 buffer (#AR9640, Leica Biosystems) for 30 min. The slides were incubated with primary antibodies for rabbit anti-CD4 (ab133616, Abcam, diluted 1:100), mouse anti-CD8 (MCA1817T, BIO-RAD, diluted 1:300), rabbit anti-PD-L1 (13684S, Cell Signaling Technologies, diluted 1:300), and mouse anti-CK (M3515, Dako, diluted 1:300) for 30 min, followed by detection with Polymer HRP Ms + Rb (ARH1001EA, Perkin-Elmer). CD4, CD8, and PD-L1-stained slides were incubated with Opal 480 TSA Plus (diluted 1:150), Opal 520 TSA Plus (diluted 1:150), and Opal 620 TSA Plus (diluted 1:150), respectively, for 10 min. Each slide was then treated with Bond Epitope Retrieval 1 buffer (#AR9961, Leica Biosystems) for 20 min to remove bound antibodies before the next step in the sequence. CK-stained slides were incubated with Opal TSA-DIG Reagent (FP1502, Perkin-Elmer, diluted 1:70) for 10 min and Opal 780 TSA Plus (diluted 1:25) for 60 min. Nuclei were subsequently stained with DAPI and the section coverslipped using HIGHDEF IHC fluoromount (ADI-950-260-0025, Enzo). The slides were imaged using a PerkinElmer Vectra Polaris Automated Quantitative Pathology Imaging System (Perkin-Elmer) and analyzed using inForm 2.4.4 software and TIBCO Spotfire (Perkin-Elmer).

Multiplex IHC data analysis

All slides were scanned at 10× magnification to select regions of interest (ROIs) using Phenochart software (ver. 1.0.10, Perkin-Elmer). ROIs included IT (within the tumor parenchyma), IM (within the lesion and approximately 500 µm on each side of the tumor margin), and PS (within the peritumoral lesion but outside the IM) regions (Supplementary Fig. 3). Three non-overlapping fields (one microscopic field, 925 × 693 µm) were selected from each region. The total number of cells in each region was calculated by the sum of the number of immunoreactive cells in three selected fields per region. The results were expressed as the mean density (cells per field) of positively stained cells.

MMR status determination and EBV in situ hybridization

Fully automated immunostaining was performed on 4-μm-thick FFPE sections using a BenchMark XT autostainer (Ventana Medical Systems, Tucson, AZ). IHC for MMR proteins was performed according to standard antibody protocols using the following antibodies: mouse anti-MLH1 (Ventana/Roche M1, pre-dilute antibody), mouse anti-MSH2 (Roche G219-1129, pre-dilute antibody), rabbit anti-MSH6 (Roche SP93, pre-dilute antibody), and mouse anti-PMS2 (Roche A16-4, pre-dilute antibody). Tumors lacking MLH1, MSH2, PMS2, or MSH6 expression were considered dMMR, whereas tumors that expressed MLH1, MSH2, PMS2, or MSH6 were considered pMMR.

EBV status was determined by in situ hybridization with EBV-encoded small RNA (EBER) probes (INFORM EBER, Roche, ready-to-use) according to product protocols. Strong EBER signals were interpreted as EBV-positive.

Classification of the TIME

Tumors were classified into three types based on CD8+ T-cell density in the IT, IM, and PS regions to characterize the pattern of immune activity11: inflamed (high CD8+ T-cell density in the IT region), immune-excluded (low CD8+ T-cell density in the IT region and high CD8+ T-cell density in the IM and PS regions), and immune-desert (low CD8+ T-cell density in the IT, IM, and PS regions). The median number of CD8+ T cells per field in the IT, IM, and PS regions in PGC and MGC (41.2 cells/field) was used as a cut-off to classify low and high CD8+ T-cell density.

The tumors were also categorized into four types according to the T-cell density (CD4+ and CD8+ cells) and PD-L1 expression in the IT and IM regions. These categories were used to predict patients who would respond to anti-PD-1 or anti-PD-L112: type I, adaptive immune resistance (high TIL density and PD-L1-positive); type II, immunological ignorance (low TIL density and PD-L1-negative); type III, intrinsic induction (low TIL density and PD-L1-positive); and type IV, immune tolerance (high TIL density and PD-L1-negative). The median numbers of CD4+ and CD8+ cells per field in the IT and IM regions in PGC and MGC (111.4 cells/field) were used as the cut-offs for classification into low and high T-cell density. PD-L1 expression was determined using the CPS, which was the number of PD-L1-stained cells divided by the total number of viable tumor cells in the IT and IM regions, multiplied by 100. Tumors were considered PD-L1-positive if the CPS ≥ 1.

RNA extraction and RNA sequencing analysis

RNA sequencing was performed on seven paired PGC and MGC FFPE tissues. Total RNA was isolated using Trizol reagent (Invitrogen, Carlsbad, CA) and the quality assessed using an Agilent 2,100 bioanalyzer with the RNA 6,000 Nano Chip (Agilent Technologies, Amstelveen, the Netherlands). RNA was quantified using an ND-2000 Spectrophotometer (Thermo Fisher Scientific, Waltham, MA). Extracted RNA samples were processed using the QuantSeq 3′mRNA-Seq Library Prep Kit (Lexogen, Vienna, Austria) according to the manufacturer’s instructions and sequenced on an Illumina NextSeq 500 (Illumina, San Diego, CA). Differentially expressed genes were defined by P < 0.05 and an absolute fold change > 2. Gene sets related to T-cell activation (immune checkpoints, immune checkpoint ligands, co-stimulatory molecules, co-stimulatory ligands, and chemokines) were defined (Supplementary Table 3) and GSVA performed. GSEA was performed to assess the enrichment of an 18-gene T-cell inflamed GEP (Supplementary Table 3) that predicted the response to anti-PD-1-directed therapy13,14. A normalized enrichment score (NSE) was specified for the GSEA. The Gene Expression Omnibus accession number for the RNA sequencing data is GSE147043.

Statistical analysis

The cell density results are expressed as mean ± standard deviation. Non-parametric Wilcoxon signed rank tests were used to compare cell density between PGC and MGC. OS was defined as the duration between metastatic disease diagnosis and death from any cause or the last follow-up visit. Survival analysis was performed using the Kaplan–Meier method, and statistical differences were assessed by log-rank tests. Univariable and multivariable analyses were performed using the Cox proportional hazard regression model and are presented as HRs and 95% CIs for each variable. Statistical analyses were performed using IBM SPSS Statistics version 21 (IBM Corporation, Armonk, NY, USA). All statistical analyses were two-sided tests with significance defined as P < 0.05.