Molecular basis of polymorphic drug metabolism