This study elucidates CD2, CD8A, GNLY, IFI44, NKG7 and OAS2 as the core genes of UC and NASH. Here, NKG7 is linked to metabolic dysfunction-associated steatohepatitis.