*2.1. Patient Selection*

We retrospectively analysed patients ≥18 years old, diagnosed with advanced NSCLC (adenocarcinoma, squamous cell carcinoma, and non-small cell lung cancer, not otherwise specified), at the Portuguese Oncology Institute of Porto (IPO-Porto) between 2014 and 2019. All tissue samples were obtained at the time of diagnosis. Samples were routinely fixed, and paraffin-embedded for standard pathological examination by haematoxylin and eosin (H&E) and specific immunostaining for tumour classification, grading, and staging, according to World Health Organization (WHO) Classification of Tumours of the Lung, Pleura, Thymus and Heart (4th Edition, Volume 7). Specimens were evaluated by two lung pathology proficient pathologists (ALC and RH). Biopsy samples available at the archive of the Department of Pathology were obtained for the "Untreated" cohort (Cohort #1, patients not exposed to anti-PD-1 blockade) and "Treated" cohort (Cohort #2, patients exposed to anti-PD-1 blockade anytime during the course of the disease) and were included after approval by the ethics committee of IPO-Porto (CES 15R1/2017).

### *2.2. Clinical and Pathological Data Collection*

Relevant clinical and pathological variables were retrospectively collected for patients' characterisation, including pathological diagnosis (adenocarcinoma, squamous cell carcinoma, not otherwise specified), gender (female, male), age, smoking habits (never smoker, smoker, previous smoker), stage of the disease (stages IIIA to IVB were considered as advanced disease) and type of anti-PD-1 treatment (nivolumab, pembrolizumab, according to the current practice at the time).

All patients whose tumours displayed ≥50% PD-L1 expression did pembrolizumab as a first-line treatment [21], patients whose tumours had 1–49% PD-L1 expression did pembrolizumab [22] or nivolumab as second line treatment, and those with negative PD-L1 expression did nivolumab as a second-line treatment after progression of disease on or after standard platinum-based chemotherapy [23,24]. In patients whose tumours presented a driver mutation (epidermal growth factor receptor (*EGFR*) tyrosine kinase mutation, anaplastic lymphoma kinase (*ALK*) gene rearrangement or c-ROS oncogene 1 (*ROS1*) translocations), treatment with anti-PD-1 was done after progression on or after tyrosine kinase inhibitors and platinum-based chemotherapy.

Response to treatment was assessed by using the Response Evaluation Criteria in Solid Tumours (RECIST): complete response (CR)—disappearance of all target lesions, pathological lymph nodes must have reduction in short axis to <10 mm; partial response (PR)—at least a 30% decrease in the sum of diameters of target lesions, taking as reference the baseline sum diameters; progressive disease (PD)—at least a 20% increase in the sum of diameters of target lesions, taking as reference the smallest sum on study which must demonstrate an absolute increase of at least 5 mm; stable disease (SD)—neither sufficient shrinkage to qualify for PR nor sufficient increase to qualify for PD. Clinical benefit was considered if CR, PR or SD were present.

All procedures performed were in accordance with the ethical standards of the institutional and national research committees and with the 1964 Helsinki declaration and its later amendments or comparable ethical standards.
