a, Number of clonotypes that contract (yellow) compared to the number of clonotypes that expand (purple) per patient. A clonotype was considered to undergo T-cell expansion when it increased in proportion on- versus pre-treatment and the frequency on-treatment was >2 (purple). A clonotype was considered to undergo T-cell contraction when it decreased in proportion on- versus pre-treatment and the frequency on-treatment was < 2 (yellow). b, Boxplot showing the difference in number of expanded versus contracted clonotypes, comparing Es (n = 9) versus NEs (n = 20). c, Percentage of T-cells in the pre-treatment biopsy (gray) per patient compared to the number of expanded clonotypes after anti-PD1 (proportion data from Fig. 1a are shown). Horizontal dotted lines indicate the thresholds used to define tumors with a high % of T-cells (gray) or with T-cell expansion (purple). d, Number of expanding T-cells per patient with clonotypes not present (novel clonotypes; green) or present (pre-existing clonotypes; gray) pre-treatment. Up to 61% (range: 27-85%) of expanded T-cells in Es on-treatment had clonotypes already present pre-treatment. e, Percentage of stromal TILs (sTILs) by histopathology on a hematoxylin and eosin stained slide, comparing Es (n = 9) versus NEs (n = 19). f, Percentage of TILs based on scRNA-seq (scTILs) determined by the fraction of B- and T-cells in each sample, comparing Es (n = 9) versus NEs (n = 20). g-h, Tumor mutation burden (TMB) (g) and chromosomal instability (h) in Es (n = 9 for TMB, n = 8 for chromosomal instability) versus NEs (n = 20 for TMB, n = 19 for chromosomal instability) and for each BC subtype; TNBC (n = 13 for TMB, n = 11 for chromosomal instability), ER−/HER2+ (n = 3) and ER+/HER2± (n = 15). i, Heatmap of normalized PD1 and UMAP color-coded for PD1. j, Normalized PD1 expression in T-cells. Panels b, e-h: exact P values by Mann-Whitney test or Wilcoxon matched-pairs signed rank test for paired samples (pre- versus on-treatment); two-sided (b, e, g-h) or one-sided (f); *P < 0.05, *P < 0.01, ***P < 0.001. Panel j: ***P < 0.001 by MAST test and Bonferonni-corrected (Seurat). Panels b, e-h: box, median ± interquartile range; whiskers, minimum and maximum.