Despite the dramatic advancement of cancer chemotherapy and immunotherapy, the insufficient progress has been made in basic or translational research on personalization of opioid therapy. Predicting the effectiveness of opioid analgesic therapy and the risk of adverse effects prior to therapy are expected to enable safer and more appropriate opioid therapy for cancer patients. In this study, we compared the incidence of opioid-induced adverse effects between patients with different variants of the genes related to responsiveness to opioid analgesics.Participants were 88 patients with lung cancer who provided general consent for exome sequencing and were treated with morphine or oxycodone at Shizuoka Cancer Center Hospital between April 2014 and August 2018. Incidence rates for 6 adverse effects of opioid therapy (somnolence, nausea, constipation, delirium, urinary retention, and pruritus) were determined and the influence of single nucleotide polymorphisms in coding regions of the opioid m receptor 1 (OPRM1) (rs1799971), opioid d receptor 1 (rs2234918), opioid k receptor 1 (rs1051660), catechol-O-methyltransferase (COMT) (rs4680), dopamine receptor D2 (rs6275), adenosine triphosphate binding cassette B1 (rs1045642), G-protein regulated inward rectifier potassium channel 2 (rs2070995), and fatty acid amide hydrolase (rs324420) genes on those adverse effects were analyzed.Analysis of OPRM1 gene variant status (Asn133Asp A > G) showed that G/G homozygotes were at significantly lower risk of somnolence compared with A allele carriers (0% vs 28.4%; Fisher exact test, P = .005; OR, 0; 95% CI, 0-0.6), and analysis of COMT gene variant status (Val158Met, G > A) showed that G/G homozygotes were at significantly higher risk of somnolence compared with A allele carriers (35.0% vs 10.4%; Fisher exact test, P = .008; OR, 4.5; 95% CI, 1.4-18.1). No relationship between variant status and adverse effects was found for the other genes.These findings demonstrate that OPRM1 and COMT gene variants influence the risk of somnolence as an adverse effect of opioid analgesic therapy.