library quality and quantity were assessed using a tapestation ( agilent ) and qubit fluorometer ( thermo fisher scientific ). libraries were sequenced on an illumina hiseq 4000 following the manufacturer ’ s instructions. library generation and sequencing were performed at the sanger institute, cambridge. sorted cd45 cells were stained with a cocktail of 79 oligo nucleot ide - conjugated abseq antibod ies ( bd biosciences, for 45 min at 4 °c. cells were then washed to remove residual unbound abseq antibod ies and loaded onto three bd rhapsody cartridges ( bd biosciences ) for single - cell capture. abseq antibod ies used in this study are listed in supplementary table 2. single - cell capture and cdna library preparation were performed using the bd rhapsody express single - cell analysis system ( bd biosciences ), according to the manufacturer ’ s instructions. briefly, cdna was amplified — ten cycles for resting cells and nine cycles for in vitro - stimulated cells — using the human immune response primer panel ( bd biosciences; supplementary table 6 ), containing 399 primer pairs and a supplementary panel of 105 primer pairs ( bd biosciences; supplementary table 3 ). the resulting pcr1 products were purified using ampure xp magnetic beads ( beckman coulter ), and the respective mrna and abseq / sample tag products were separated based on size selection, using different bead ratios ( 0. 7× and 1. 2×, respectively ). the purified mrna and sample tag pcr1 products were further amplified ( ten cycles ), and the resulting pcr2 products purified by size selection ( 1× and 1. 2× for the mrna and sample tag libraries, respectively ). the concentration, size and integrity of the resulting pcr products were assessed using both qubit ( high - sensitivity dsdna kit; thermo fisher ) and the agilent 4200 tapestation system ( high sensitivity d1000 screentape; agilent ). the final products were normalized to 2. 5 ng μl ( mrna ), 0. 5 ng μl ( sample tag ) and 0. 275 ng μl ( abseq ) and underwent a final round of amplification ( six cycles for mrna and eight cycles for sample tag and abseq ) using indexes for illumina sequencing to prepare the final libraries. final libraries were quantified using qubit and agilent tapestation and pooled ( ~ 60 % / 38 % / 2 % mrna / abseq / sample tag ratios, respectively ) to achieve a final concentration of 5 nm. final pooled libraries were spiked with 10 % phix control dna to increase sequence complexity and sequenced ( 75 base pairs ( bp ), paired - end ) on a hiseq 4000 sequencer ( illumina ). cryopreserved, oct - embedded duodenal biopsy samples were stored at −80 °c until use. before performing the full protocol, a tissue permeabilization optimization was performed ( 10x genomics, visium spatial tissue optimization ), which identified 11 min as the optimum permeabilization time. samples were processed for spatial transcriptomics per the manufacturer ’ s instructions ( 10x genomics, visium spatial ), with 2 × 10 - μm sections cut on a pre - cooled cryostat for each sample onto two 6. 5 × 6. 5 - mm capture areas, each with approximately 5, 000 oligo nucleot ide - barcoded 55 - μm - diameter spots. slides were fixed, h & e stained and imaged on a leica dmi8 widefield microscope at a magnification of ×40. tissue was permeabilized per instructions for 11 min, followed by reverse transcription and second - strand synthesis performed on the slide. cdna quantification was performed using qpcr using kapa sybr fast - qpcr kit ( kapa biosystems ) on a cfx96 thermal cycler instrument ( bio - rad ). following library construction per instructions, the spatial transcriptomics libraries were quantified and pooled at a concentration of 4 nm with a sample ratio corresponding to the approximate surface area of tissue coverage obtained from the h & e imaging. pooled libraries were sequenced on a nextseq ( illumina ) using a 150 - bp paired - end dual - indexed setup ( high output, v2. 5, illumina ) loaded at a concentration of 1. 8 pm, and sequenced to a manufacturer - recommended depth of a minimum of 50, 000 reads per tissue - covered spot. cryopreserved, oct - embedded duodenal biopsy samples were stored at −80 °c until use. spatial transcriptomics was performed using the visium cytassist ( 10x genomics ) workflow for fresh - frozen tissue according to the manufacturer ’ s instructions. ten - micron sections were cut on a cryostat pre - cooled to −20 °c and placed on 11 × 11 - mm areas ( four sections per area ) on superfrost plus slides ( thermo fisher ). sections were fixed, h & e stained and imaged on an axioscan z1 slide scanner ( zeiss ) at a magnification of ×20. sections were de - stained and subjected to on - slide probe hybri diz ation and ligation followed by probe transfer onto visium cytassist spatial gene expression slides, each containing an 11 × 11 - mm capture area covered by approximately 14, 000 55 - µm - diameter oligo nucleot ide - barcoded spots. probes were extended and cdna quantified by qpcr using a kapa sybr fast - qpcr kit ( kapa biosystems ) on a cfx96 thermal cycler instrument ( bio - rad ), followed by off - slide library construction per the instructions. libraries were quantified and pooled at a concentration of 2 nm with a sample ratio corresponding to the approximate surface area of tissue coverage obtained from the h & e imaging. pooled libraries were sequenced on a nextseq 500 instrument ( illumina ) using a 150 - bp paired - end dual - indexed setup ( high output, v2. 5, illumina ) at a manufacturer - recommended depth of a minimum of 50, 000 reads per tissue - covered spot. a trizol nucleic acid extraction method was used to extract rna from low numbers of sorted lymphocytes, as previously described, except that phase - lock gel tubes were replaced with standard 1. 5 ml microcentrifuge tubes. briefly, after sorting, cells were centrifuged ( 500 g, 5 min ), resuspended in 1 ml trizol, then frozen at −80 °c until rna extraction. for rna extraction, samples were thawed, mixed with 200 μl chloroform and centrifuged ( 14, 000 g, 5 min ). a total of 500 μl of the aqueous phase was taken and rna was extracted using the agencourt rnadvance tissue isolation kit. rna concentration and purity were assessed on a 2100 bioanalyzer instrument ( agilent ). bulk rna - seq was performed using the smart - seq2 protocol at the oxford genomics centre ( university of oxford ). around 10 ng rna was used as a template from each sample for library generation. barcoded samples were pooled, and external rna controls consortium rna ( 1: 100, 000 dilution ) was added before 75 - bp paired - end sequencing on an illumina hiseq 4000 instrument. bulk tcr repertoire sequencing was performed using the amplicon - rescued multiplex - pcr method ( irepertoire ). this method performs an initial first - round rt – pcr with tcr v and c gene - specific primers for the relevant tcr chain, followed by further amplification steps with universal primers for the exponential phase of amplification. this method is designed to provide quantitative, deep sequencing of the tcr repertoire, with minimal bias. library generation was performed following the manufacturer ’ s instructions, except for using 96 - well plates. the quality, size distribution, concentration and presence of contaminating primer dimers of the final product was assessed using agarose gel electrophoresis, a spectral photometer ( nanodrop, thermo fisher scientific ), and the bioanalyser dna 1000 assay using a 2100 bioanalyzer instrument ( agilent ). libraries were quantified using the kapa library quantification kit ( roche ) on a cfx96 thermal cycler instrument ( bio - rad ) before equimolar pooling. a phix library spike - in was added ( 10 % ) due to the low diversity of the tcr library, before 300 - bp paired - end sequencing on an illumina miseq instrument at the oxford genomics centre. this was an observational, descriptive study. the experiments were not randomized.