Skip to main content

Prediction of opioid dose in cancer pain patients using genetic profiling: not yet an option with support vector machine learning



Use of opioids for pain management has increased over the past decade; however, inadequate analgesic response is common. Genetic variability may be related to opioid efficacy, but due to the many possible combinations and variables, statistical computations may be difficult. This study investigated whether data processing with support vector machine learning could predict required opioid dose in cancer pain patients, using genetic profiling. Eighteen single nucleotide polymorphisms (SNPs) within the µ and δ opioid receptor genes and the catechol-O-methyltransferase gene were selected for analysis.


Data from 1237 cancer pain patients were included in the analysis. Support vector machine learning did not find any associations between the assessed SNPs and opioid dose in cancer pain patients, and hence, did not provide additional information regarding prediction of required opioid dose using genetic profiling.


Opioids are the basis in treatment of severe pain of both benign and malignant origin. Unfortunately, the clinical use is limited by large inter-individual differences in analgesic responses, and insufficient treatment is often seen. Unacceptable side effects may also appear, potentially reducing quality of life. Thus, identification of biomarkers that can predict the appropriate opioid type and dose for the individual patient is highly warranted. Currently, there is no well-validated objective means of identifying patients likely to experience adequate opioid analgesia, and quantitative sensory testing as well as clinical biomarkers have been applied with low success [13].

Various factors such as gender, age, and genetic variation may influence the analgesic response to opioids. Several single nucleotide polymorphisms (SNPs) in different candidate genes have been demonstrated to be associated with altered pain sensitivity and analgesic response [4]. The genetic variations can influence the pharmacokinetics and/or pharmacodynamics of opioids and potentially the effect. A large study, the European Pharmacogenetic Opioid Study (EPOS) included 2294 cancer pain patients and investigated the influence of genetic variability on multiple pain-related outcomes and required opioid dose [5, 6]. No significant associations were found between 112 SNPs in 25 candidate genes and opioid dose, thus the findings did not support the use of genetics profiling to guide opioid treatment. However, statistical analysis including multiple testing of several factors may be a limitation. In contrast, machine learning can include many factors in a single analysis, limiting the risk of erroneous false-positive results [7]. Support vector machine (SVM) is a data driven method, which enables detection of subtle patterns in complex datasets, which are only visible when assessing multiple variables at once. This could be the case for genetic data, where certain combinations of genes could determine the effect.

The objective of the present study was to use SVM analysis of various SNPs to predict the required opioid dose in cancer pain patients.

Main text


Study design and patient samples

Data from the EPOS study was used for analysis [6]. In brief, the study included patients from 17 centres in 11 European countries. Inclusion criteria were: age > 18 years; diagnosed with a malignant disease; using opioids for moderate to severe pain; treated with regular oral, subcutaneous, transdermal or intravenous opioids (morphine, methadone, fentanyl, hydromorphone, buprenorphine, or oxycodone) for a minimum of 3 days.

Study outcome

The median oral morphine equivalent dose in the full population of 2294 patients was 180 mg/24 h. Therefore, patients were divided into two groups: Group 1 requiring less or equal to 180 mg/24 h; group 2 requiring more than 180 mg/24 h.

Gene selection and genotyping

In the present study, nineteen SNPs; nine SNPs in the OPRM1 gene, one in OPRK1, three in OPRD1 and six in COMT, were selected as relevant. The SNPs were selected according to previous studies, in which genetic associations to opioid analgesic effects were found [4, 8, 9]. The genotype distributions are listed in Table 1. As minor allele frequency had to be higher than 10% to be included in data analysis, the OPRK1 was discarded. SNPs were coded to be binary variables for inclusion in the SVM, hence, they were coded so that carriage of the minor allele equals 1 and homozygous for the major allele equals 0 in the model.

Table 1 Genotype distribution in the study population

Machine learning analysis

SVM is a binary classifier, previously used in other prediction studies in pain medicine [10, 11]. In the present study, classification was performed using the libSVM toolbox (version 3.20) for Matlab [11], and a linear kernel function was used to avoid over-fitting of the model [12]. The analysis process is described in details elsewhere [13]. In brief, 10 features along with a label indicating to which opioid dose group the patient belonged to were analyzed in the SVM. The number of features was determined by calculating the accuracy of the classifier by gradually increasing the number of features up to 10. Accuracy was defined as the ratio between correctly classified subjects and total number of subjects in percentage. Based on this, the SVM calculated an optimal decision rule to separate the two groups in the most optimal way. This was done by leave-one-out cross-validation by extracting one patient for testing, and using the remaining patients to train the model. This process was repeated until all patients had been left out. Once a decision rule was determined, a classification accuracy for each of the 10 features was calculated.

Statistical analysis

The null hypothesis was that SVM analysis of various SNPs could not predict the required opioid dose in cancer pain patients. All data are reported as mean ± standard deviation. Results from SVM classification were analyzed using Chi square tests. P values below 0.05 were considered statistically significant.


Out of 2294 EPOS participants, 1057 were excluded due to missing one or several of the selected SNPs. The included 1237 patients (637 males and 600 females) had an age of 62.6 ± 12.3 years and BMI of 23.4 ± 4.6). Of these, 662 (53%) required less or equal to 180 mg/24 h oral morphine equivalents, and 575 (47%) required more than 180 mg/24 h.

Machine learning was unable to distinguish between patients requiring less or equal to 180 mg/24 h oral morphine equivalents and those requiring more, using any number of SNP features from 1 to 10. Classification accuracies were: 1 feature; 52.9% (P = 0.08), 2 features; 52.9% (P = 0.08), 3 features; 52.9% (P = 0.08), 4 features; 52.9% (P = 0.08), 5 features; 52.9% (P = 0.08), 6 features; 53.0% (P = 0.07), 7 features; 53.0% (P = 0.07), 8 features; 53.0% (P = 0.07), 9 features; 53.0% (P = 0.07) and 10 features; 52.8% (P = 0.08).


This study aimed to investigate whether SVM was able to identify associations between genetic variability and required opioid dose in cancer pain patients. None of the chosen 18 SNPs in the three candidate genes showed significant association with opioid dose, which support earlier findings from the EPOS study in which regular linear regressions were unable to identify correlations [6]. Hence, SVM analysis did not provide additional information regarding prediction of opioid dose using genetic profiling.


A single SNP may only explain a minor part of analgesic variability. A recent study showed that combinations of genetic variants, e.g. in OPRM1 and COMT better explained variability in morphine consumption than single genetic variants [14]. Thus, one advantage of SVM is the possibility to include several SNPs in one analysis, compared to simple linear regression. However, for each SNP three genotypes exist. When using a binary variable which is necessary for SVM analysis, a dominant genetic model is assumed, which may not be optimal. Furthermore, the high number of SNPs included in the analysis may result in a lower accuracy. Additionally, if epistasis, which is the interaction between genes, is present, the effect of one SNP may be altered or masked by the effect of another SNP and thereby reduce the power to detect genetic associations. Thus, from the present study, it cannot be excluded that some SNPs in the selected genes are associated with required opioid dose.

Various statistical methods (based on general linear models) to predict and assess data relationship exist, but here, a SVM approach was selected, according to two reviews [15, 16]. Machine learning differs from conventional statistics, in that there is no predefined model and assumption of data normality, and each patient is classified at the individual level rather than the group. Furthermore, SVM can find non-linear relationships in data, and assess complex associations between several parameters. The latter is different from the traditional one-at-time approach in statistics, where relatively few variables can be tested. On the contrary, the SVM model can be over-fitted to the data and thus loose generalizability. Moreover, the method is relatively new, and many clinicians and researchers are not familiar with the method and output from the model.

Although the method of SVM presents itself with several limitations, methodological limitations of the study design itself may also have had an influence on the result. First, as opioid dose was the primary outcome in the EPOS study, it was used as outcome in the present study as well. Here it was anticipated that opioid dose is related to opioid response, i.e. high dose = less responsiveness to opioid analgesia, and low dose = high responsiveness to opioid analgesia, however this is only a rough estimation and many other factors may be important. Hence, a composite score taking pain intensity, opioid dose and side-effects into consideration might be a better outcome for association analyses of opioid efficacy [17]. However, such a composite score has not been developed or validated for cancer pain patients. In addition, only three opioid receptor genes were included in the analysis. Future studies should include more, as well as SNPs within genes other than those related to opioid receptor signaling, e.g. genes coding for pharmacokinetic factors. For instance, associations between SNPs within the ATP-binding cassette transporter- and cytochrome P450 genes and opioid analgesia have been found in both healthy volunteer and patient studies [4, 17].

Moreover, as human genetic factors only account for part of the inter-individual difference in pain sensitivity, several cofactors may also influence opioid consumption during the post-operative period. These include age, gender, mood, anxiety, drug–drug interactions and epigenetic factors. Thus, human experimental pain studies, conducted in a controlled setting, have shown to be of value to explore the genetic contribution to both pain sensitivity and analgesic responses [18].



several single nucleotide polymorphisms


European Pharmacogenetic Opioid Study


support vector machine


  1. Grosen K, Fischer IWD, Olesen AE, Drewes AM. Can quantitative sensory testing predict responses to analgesic treatment? Eur J Pain. 2013;17(9):1267–80.

    Article  CAS  PubMed  Google Scholar 

  2. Bruehl S, et al. Personalized medicine and opioid analgesic prescribing for chronic pain: opportunities and challenges. J Pain. 2013;14(2):103–13.

    Article  PubMed  PubMed Central  Google Scholar 

  3. Gram M, et al. Prediction of postoperative opioid analgesia using clinical-experimental parameters and electroencephalography. Eur J Pain (UK). 2017;21(2):264–77.

    Article  CAS  Google Scholar 

  4. Nielsen LM, Olesen AE, Branford R, Christrup LL, Sato H, Drewes AM. Association between human pain-related genotypes and variability in opioid analgesia: an updated review. Pain Pract. 2015;15(6):580–94.

    Article  PubMed  Google Scholar 

  5. Fladvad T, Fayers P, Skorpen F, Kaasa S, Klepstad P. Lack of association between genetic variability and multiple pain-related outcomes in a large cohort of patients with advanced cancer: the European Pharmacogenetic Opioid Study (EPOS). BMJ Support Palliat Care. 2012;2(4):351–5.

    Article  PubMed  Google Scholar 

  6. Klepstad P, et al. Influence from genetic variability on opioid use for cancer pain: a European genetic association study of 2294 cancer pain patients. Pain. 2011;152(5):1139–45.

    Article  CAS  PubMed  Google Scholar 

  7. Gram M, Graversen C, Olesen AE, Drewes AM. Machine learning on encephalographic activity may predict opioid analgesia. Eur J Pain (UK). 2015;19(10):1552–61.

    Article  CAS  Google Scholar 

  8. Smith M, Muralidharan A. Pharmacogenetics of pain and analgesia. Clin Genet. 2012;82(4):321–30.

    Article  CAS  PubMed  Google Scholar 

  9. Kim H, et al. Genetic influence on variability in human acute experimental pain sensitivity associated with gender, ethnicity and psychological temperament. Pain. 2004;109(3):488–96.

    Article  PubMed  Google Scholar 

  10. Graversen C, Drewes AM, Farina D. Support vector machine classification of multi-channel EEG traces: a new tool to analyze the brain response to morphine treatment,” in 2010 Annual International Conference of the IEEE Engineering in Medicine and Biology, 2010, pp. 992–5.

  11. Chang C-C, Lin C-J. LIBSVM. ACM Trans Intell Syst Technol. 2011;2(3):1–27.

    Article  Google Scholar 

  12. Gong Q, et al. Prognostic prediction of therapeutic response in depression using high-field MR imaging. Neuroimage. 2011;55(4):1497–503.

    Article  PubMed  Google Scholar 

  13. Cortes C, Vapnik V. Support-vector networks. Mach Learn. 1995;20(3):273–97.

    Google Scholar 

  14. De Gregori M, et al. Human genetic variability contributes to postoperative morphine consumption. J Pain. 2016;17(5):628–36.

    Article  PubMed  Google Scholar 

  15. Orrù G, Pettersson-Yeo W, Marquand AF, Sartori G, Mechelli A. Using support vector machine to identify imaging biomarkers of neurological and psychiatric disease: a critical review. Neurosci Biobehav Rev. 2012;36(4):1140–52.

    Article  PubMed  Google Scholar 

  16. Pombo N, Araújo P, Viana J. Knowledge discovery in clinical decision support systems for pain management: a systematic review. Artif Intell Med. 2014;60(1):1–11.

    Article  PubMed  Google Scholar 

  17. Silverman DG, O’connor TZ, Brull SJ. Integrated assessment of pain scores and rescue morphine use during studies of analgesic efficacy. Anesth Analg. 1993;77(1):168–70.

    CAS  PubMed  Google Scholar 

  18. Olesen AE, Andresen T, Staahl C, Drewes AM. Human experimental pain models for assessing the therapeutic efficacy of analgesic drugs. Pharmacol Rev. 2012;64(3):722–79.

    Article  CAS  PubMed  Google Scholar 

Download references

Authors’ contributions

PK and FS collected, analyzed and interpreted data from the EPOS study. AEO, DG, MG and AMD analyzed and interpreted the SVM data regarding associations between opioid consumption and genetic profiling. All authors contributed to the final manuscript. All authors read and approved the final manuscript.


Not applicable.

Competing interests

The authors declare that they have no competing interests.

Availability of data and materials

The datasets used and/or analyzed during the current study are available from the corresponding author on reasonable request.

Consent for publication

Not applicable.

Ethics approval and consent to participate

The EPOS study was conducted in accordance with the Declaration of Helsinki. Ethical approval was obtained from the local ethical committee in each participating study centre (Norway: The Regional Committee for Medical Research Ethics; Denmark: De Videnskabsetiske Komitéer for Københavns og Frederiksbergs Kommuner; Germany: Ethik-kommission an der Medizinischen Fakultät in Aachen; Iceland: The National Bioethics Committee of Iceland; Italy; Il Comitato Etico Independente, Comitato Etico dell’ Azienda-Unita’ Sanitaria Locale De Forli’, Comitato Etico Centrale dell’ Fondazione Salvatore Muageri; Lithuania: Lithuanian Bioethics Committee; Sweden: Regionala Etikprövningensnämnden i Stockholm; Switzerland: Etikkommission des Kantos St. Gallen; United Kingdom: The Royal Marsden Local Research Ethics Committee). Written informed consent was obtained from each volunteer.


Not applicable.

Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Author information

Authors and Affiliations


Corresponding author

Correspondence to Pål Klepstad.

Rights and permissions

Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (, which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The Creative Commons Public Domain Dedication waiver ( applies to the data made available in this article, unless otherwise stated.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Olesen, A.E., Grønlund, D., Gram, M. et al. Prediction of opioid dose in cancer pain patients using genetic profiling: not yet an option with support vector machine learning. BMC Res Notes 11, 78 (2018).

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: