In a novel approach that used electronic health record and genomic information from a relatively large patient cohort to conduct a genome wide study on opioid use disorder, we conducted a genome-wide analysis of OUD in a clinical population of over 20,000 patients. As clinical biobanks continue to grow, this method may offer new insights into the genetic architecture of OUD and related disorders.