Enrichment of CD4 T cell states within tumor regions (pre-ranked GSEA), comparing scRNA-seq data mapped to MERSCOPE (CytoSPACE) with MERSCOPE alone (for underlying data, see Supplementary Table 9). Color scale is defined in Extended Data Fig. 10i. Two-sided nominal P values in c and f were determined by GSEA. In d and f, the box center lines, box bounds and whiskers denote the medians, first and third quartiles and minimum and maximum values within 1.5× the interquartile range of the box limits, respectively. Group comparisons in d and f were determined relative to CytoSPACE via a two-sided, paired Wilcoxon test. In i and k, concordance was assessed by Pearson correlation and linear regression, with 95% confidence intervals indicated in i. A two-sided t -test was used to assess whether each correlation result was significantly non-zero. Adjustments for multiple comparisons were made in f using the Benjamini–Hochberg method.