Development and validation of the polygenic risk scores (PRSs): LDPred2 method was used to tune the parameters for the PRS for ulcerative colitis and Crohn’s disease (PRSUC, PRSCD) in 70% of the UK Biobank, using the summary statistics from the largest genome-wide association study of UC and CD. The PRSs were then tested in the remaining 30% of the UK Biobank and validated in BioVU. In the next step, the role of PRSUC and PRSCD on all-grade and severe immune checkpoint inhibitor-mediated colitis (IMC) was evaluated in a cohort of 1,316 non-small cell lung cancer patients who received at least one dose of immune checkpoint inhibitor therapy. Furthermore, replication was conducted using 873 pancancer patients treated with immune checkpoint inhibitors obtained from BioVU. Finally, associations of all-grade and severe IMC along with PRSUC and PRSCD on progression-free survival (PFS) and overall survival (OS) were assessed.