This randomized clinical trial compares the efficacy of treatment guided by pharmacogenomic testing vs usual care to determine whether pharmacogenomic testing affects antidepressant medication selection and whether such testing leads to better clinical outcomes among patients with major depressive disorder (MDD).