Codeine is metabolized by CYP2D6, so variations in the CYP2D6 gene may influence the dose at which codeine is effective. As pro-drug, codeine is not active until it has been metabolised into morphine. Codeine is turned into morphine in the liver by CYP2D6 which is what gives it its pain relieving properties. If CYP2D6 is not very active there will not be much morphine made and taking codeine will not be helpful for reducing pain. If CYP2D6 is extra active, too much morphine is made too quickly.
[PMID 1782973] Codeine is ineffective at typical doses in up to 10% of Caucasians carrying two nonfunctional CYP2D6 alleles.
On the other hand, 1-2% of Caucasians are considered ultrafast metabolizers of codeine. These individuals respond very quickly even to small doses of codeine, which in some cases can be quite dangerous. At the genetic level, this can come about due to either SNPs or CNVs.
FDA WARNING: The FDA has issued a warning to breastfeeding mothers taking codeine or related morphine derivatives who are ultra-rapid codeine metabolizers, as they may be putting their infants at an increased risk of morphine overdose. This is based on a report of a 13-day-old breastfed infant who died from a morphine overdose. Even though the mother was given small codeine doses to treat episiotomy pain, morphine levels in the milk were abnormally high. A genetic test found that the mother was an ultra-rapid metabolizer. Providers are advised to prescribe codeine-containing products at the lowest necessary dose for the shortest amount of time to breastfeeding mothers.
Related FDA Webpage: http://www.fda.gov/bbs/topics/NEWS/2007/NEW01685.html