The function of RPAP2 (RNA polymerase II associated protein 2, ENSG00000122484) is as follows. Protein phosphatase that displays CTD phosphatase activity and regulates transcription of snRNA genes. Recognizes and binds phosphorylated 'Ser-7' of the C-terminal heptapeptide repeat domain (CTD) of the largest RNA polymerase II subunit POLR2A, and mediates dephosphorylation of 'Ser-5' of the CTD, thereby promoting transcription of snRNA genes (PubMed:17643375, PubMed:22137580, PubMed:24997600). Downstream of EIF2AK3/PERK, dephosphorylates ERN1, a sensor for the endoplasmic reticulum unfolded protein response (UPR), to abort failed ER-stress adaptation and trigger apoptosis (PubMed:30118681). {ECO:0000269|PubMed:17643375, ECO:0000269|PubMed:22137580, ECO:0000269|PubMed:24997600, ECO:0000269|PubMed:30118681}.