Pharmacogenomics Before Surgery: Genes and Pain Relief

13 min read · Last reviewed: August 2026 · Vytautas Jazbutis

You are scheduled for knee replacement next month. Your surgeon mentions post-operative pain management — you will get a combination of opioids and anti-inflammatories to control pain during recovery. What neither of you knows, unless you have been genetically tested, is whether those specific medications will actually work in your body.

Depending on population, up to about 5% of people cannot activate codeine or tramadol at all due to a CYP2D6 enzyme deficiency (Gaedigk et al. 2017). A large share of patients (higher in East Asian populations than in European populations) also carry an OPRM1 variant linked to somewhat higher opioid requirements after surgery, though the effect on any individual patient's dose is modest and not precise enough to guide dosing on its own. These are not rare edge cases — in a surgical ward of 20 patients, several will have a genetic profile that changes how their pain should be managed.

Pharmacogenomic testing before surgery identifies these variables in advance, giving your surgical team the information they need to choose the right medications at the right doses — before the first incision.

On this page+

Why Genetics Matter Before Surgery

Post-surgical pain management relies on a relatively small set of medications, and several of them have strong pharmacogenomic evidence. Knowing your genetic profile changes three specific clinical decisions.

Opioid Activation: CYP2D6

Codeine and tramadol are prodrugs — they are pharmacologically inactive until your liver converts them to their active forms (morphine and O-desmethyltramadol, respectively). The enzyme responsible is CYP2D6. Your CYP2D6 metabolizer status determines the outcome:

  • Poor metabolizers (up to about 5% of people, depending on population) produce little or no CYP2D6 enzyme. Codeine provides zero pain relief for these patients. Tramadol is equally ineffective. Prescribing either drug after surgery wastes critical recovery time while the patient suffers unnecessarily.
  • Ultrarapid metabolizers (~1–2% of European populations, higher in North African and Middle Eastern populations) convert prodrugs too quickly, creating dangerously high levels of the active metabolite. The FDA's codeine boxed warning specifically addresses this risk in children — describing fatal respiratory depression in pediatric patients, often after tonsillectomy or adenoidectomy, who were CYP2D6 ultrarapid metabolizers — and codeine is contraindicated in children under 12. CPIC guidelines extend the same concern to ultrarapid metabolizers of any age, recommending codeine be avoided regardless of the patient's age.
  • Normal and intermediate metabolizers respond to codeine and tramadol as expected, though intermediate metabolizers may experience slightly reduced efficacy.

The bottom line: if your surgical team plans to prescribe codeine or tramadol after your procedure, your CYP2D6 status determines whether that plan will work.

Opioid Receptor Sensitivity: OPRM1

Even when an opioid is properly activated, it still needs to bind to your mu-opioid receptors to reduce pain. The OPRM1 A118G variant (rs1799971) reduces receptor expression and binding affinity. A meta-analysis of postoperative studies found that G-allele carriers require a somewhat higher opioid dose for equivalent analgesia, and the CPIC guideline covering OPRM1 describes the effect on post-operative morphine requirements as modest — on the order of a 10% increase in some studies — and too small on its own to support a specific dosing recommendation.

Without genetic testing, this can still contribute to a patient who keeps pressing the PCA (patient-controlled analgesia) button and reporting inadequate pain control — leading to delays and dose escalation. Knowing the OPRM1 status in advance can add useful context, though it is one input among several rather than a precise predictor of the dose a given patient will need.

NSAID Safety: CYP2C9

Non-steroidal anti-inflammatory drugs are a cornerstone of multimodal post-surgical pain management. Celecoxib (Celebrex), ibuprofen, and meloxicam are all metabolized by CYP2C9. Poor metabolizers of CYP2C9 clear these drugs more slowly, leading to higher sustained blood levels and increased risk of gastrointestinal bleeding and cardiovascular events.

CPIC guidelines recommend dose reductions or alternative NSAIDs for CYP2C9 poor metabolizers — a recommendation that is particularly relevant in the post-surgical context where NSAIDs are often prescribed for days or weeks.

Which Medications Are Affected

Here are the specific pre-operative and post-operative medications with pharmacogenomic implications:

  • Codeine — CYP2D6 prodrug. No effect in poor metabolizers. Toxicity risk in ultrarapid metabolizers.
  • Tramadol — CYP2D6 prodrug. Same activation pathway as codeine. Poor metabolizers get minimal analgesia.
  • Hydrocodone — partially activated by CYP2D6 to hydromorphone. Poor metabolizers may experience reduced efficacy.
  • Morphine, fentanyl, oxycodone — all bind to the mu-opioid receptor encoded by OPRM1. A118G carriers may need higher doses.
  • Celecoxib — metabolized by CYP2C9. Poor metabolizers require dose reduction per CPIC guidelines.
  • Ondansetron (Zofran) — a first-line 5-HT3 receptor antagonist commonly used for nausea and vomiting during and after surgery. Metabolized by CYP2D6. Ultrarapid metabolizers may clear it too quickly, reducing its effectiveness.

The Pre-Op Pharmacogenomic Checklist

If you want to use pharmacogenomic information before your procedure, follow these practical steps:

  1. Get tested before your procedure date. If you have 23andMe or AncestryDNA raw data, you can generate a pharmacogenomic report in minutes. If you need clinical-grade testing, allow 1–2 weeks for lab results.
  2. Review your results. Focus on OPRM1 receptor status and CYP2C9 metabolizer phenotype. If you had clinical-grade testing, your CYP2D6 metabolizer phenotype is the other key line — note that a consumer raw-data analysis cannot supply it, since CYP2D6 status depends on structural variants an array cannot detect. Understanding what these mean is covered in our guide to reading your results.
  3. Share results with your anesthesiologist. Do this during your pre-operative consultation, not on the day of surgery. The provider-ready summary in your results is designed to be reviewed in under a minute.
  4. Bring your results to the hospital. Even if your anesthesiologist reviewed the results during pre-op, the provider managing your post-operative pain may be different. Having them in your chart ensures continuity.
  5. Ask specific questions. "Given my CYP2D6 status, will codeine/tramadol work for me?" is a concrete question your surgeon can act on. "I had genetic testing" without specifics is less useful.

How to Get Tested

There are two main paths to pharmacogenomic testing before surgery:

Option 1: Reuse existing DNA data. If you have already taken a 23andMe or AncestryDNA test, your raw data file contains the genetic positions needed for pharmacogenomic analysis. DecodeMyBio's Pain & Anesthesia analysis covers OPRM1, COMT, BDNF, and other pain-relevant genes from this data — free to start ($59 one-time), results in minutes. This is the fastest and most affordable option. It does not include CYP2D6: that gene needs a specialized structural-variant caller a consumer array cannot provide, so we do not report it rather than invent a result the data cannot support. If your pre-op plan hinges on codeine or tramadol, that is the case for Option 2. Learn more about at-home pharmacogenomic testing.

Option 2: Clinical pharmacogenomic panel. If you do not have consumer DNA data, your doctor can order a clinical PGx test (such as GeneSight, Tempus, or OneOme). These typically cost $100–$2,000+ depending on insurance, and results take 1–2 weeks. See our pharmacogenomic testing cost breakdown for details.

Either approach gives you the key information. The advantage of reusing consumer DNA data is speed and cost — you can have results before your next appointment rather than waiting for a lab.

Get your Pain & Anesthesia results before your next procedure. Upload your existing 23andMe or AncestryDNA data to find out your OPRM1 receptor status, COMT and BDNF pain-signalling variants, and which pain medications may need adjustment — free to start ($59 one-time), results in minutes. CYP2D6 is not included; a genotyping array cannot support a reliable CYP2D6 result. View a sample →, or upload your data to get started.

References

  1. Gaedigk A, et al. Prediction of CYP2D6 phenotype from genotype across world populations. Genet Med. 2017;19(1):69-76. PMID: 27388693.
  2. CPIC Guideline for Codeine and CYP2D6 (now includes 2021 update covering tramadol, hydrocodone, OPRM1, and COMT).
  3. Crews KR, et al. Clinical Pharmacogenetics Implementation Consortium Guideline for CYP2D6, OPRM1, and COMT Genotypes and Select Opioid Therapy. Clin Pharmacol Ther. 2021;110(4):888-896. PMID: 33387367.
  4. DailyMed (NLM). Codeine Sulfate Tablets Prescribing Information — Boxed Warning: ultra-rapid metabolism of codeine due to CYP2D6 polymorphism and risk of life-threatening respiratory depression.
  5. CPIC Guideline for NSAIDs Based on CYP2C9 Genotype, 2020.
  6. Moore C, et al. Clinical Pharmacogenetics Implementation Consortium (CPIC) Guideline for CYP2D6 Genotype and Use of 5-HT3 Receptor Antagonists: 2026 Update. Clin Pharmacol Ther. 2026;120(2):387-393. PMID: 41979467. (Updates Bell GC, et al. 2017; PMID: 28002639 — CPIC states the therapeutic recommendations are unchanged.)
  7. Ren ZY, et al. The impact of genetic variation on sensitivity to opioid analgesics in patients with postoperative pain: a systematic review and meta-analysis. Pain Physician. 2015;18(2):131-152. PMID: 25794200.

DecodeMyBio provides informational pharmacogenomic and genomic insights only. This is not medical or nutritional advice. Always consult your healthcare provider before making medication or supplement changes.

How this content is created and kept current: Methodology · Editorial policy · Limitations

Medical Disclaimer

DecodeMyBio provides informational pharmacogenomic insights only. This is not medical advice. Always consult your healthcare provider before making medication changes.