BackgroundUC patients suffer more from colorectal cancer (CRC) than the general population, which increases with disease duration. Early colonoscopy is difficult because ulcerative colitis-associated colorectal cancer (UCAC) lesions are flat and multifocal. Our study aimed to identify promising UCAC biomarkers that are complementary endoscopy strategies in the early stages.MethodsThe datasets may be accessed from the Gene Expression Omnibus and The Cancer Genome Atlas databases. The co-expressed modules of UC and CRC were determined via weighted co-expression network analysis (WGCNA). The biological mechanisms of the shared genes were exported for analysis using the Gene Ontology and Kyoto Encyclopedia of Genes and Genomes. To identify protein interactions and hub genes, a protein-protein interaction network and CytoHubba analysis were conducted. To evaluate gene expression, external datasets and experimental validation of human colon tissues were utilized. The diagnostic value of core genes was examined through receiver operating characteristic (ROC) curves. Immune infiltration analysis was employed to investigate the associations between immune cell populations and hub genes.ResultsThree crucial modules were identified from the WGCNA of UC and CRC tissues, and 33 coexpressed genes that were predominantly enriched in the NF-κB pathway were identified. Two biomarkers (CXCL1 and BCL6) were identified via Cytoscape and validated in external datasets and human colon tissues. CRC patients expressed CXCL1 at the highest level, whereas UC and CRC patients showed higher levels than the controls. The UC cohort expressed BCL6 at the highest level, whereas the UC and CRC cohorts expressed it more highly than the controls. The hub genes exhibited significant diagnostic potential (ROC curve > 0.7). The immune infiltration results revealed a correlation among the hub genes and macrophages, neutrophils and B cells.ConclusionsThe findings of our research suggest that BCL6 and CXCL1 could serve as effective biomarkers for UCAC surveillance. Additionally, they demonstrated a robust correlation with immune cell populations within the CRC tumour microenvironment (TME). Our findings provide a valuable insight about diagnosis and therapy of UCAC.