We thank M. Chu, C. Hanson, K. Villers, and J. Velasquez for help with cloning and expression, T. Grant for XFEL data processing, and H. Shaye for technical support. This work was supported by the National Institutes of Health grants R35 GM127086 (V.C.), R21 DA042298 (W.L.), R01 GM124152 (W.L.), U24DK116195 (B.L.R.), R01MH112205 (B.L.R.), the NIMH Psychoactive Drug Screening Program and the Michael Hooker Distinguished Professorship to B.L.R. and F31-NS093917 (R.H.J.O.), the STC Program of the National Science Foundation (NSF) through BioXFEL (No. 1231306) (B.S., U.W., W.L., N.A.Z., V.C.), NSF ABI grant 1565180 (C.L, N.Z., U.W.), HFSP long-term fellowship LT000046/2014-L (L.C.J.), postdoctoral fellowship from the Swedish Research Council (L.C.J.) and EMBO ALTF 677-2014 (B.S.). Parts of this research were carried out at the LCLS, a National User Facility operated by Stanford University on behalf of the US Department of Energy and supported by the US Department of Energy Office of Science, Office of Basic Energy Sciences under Contract No. DE-AC02-76SF00515. This research benefited from the use of credits from the National Institutes of Health (NIH) Cloud Credits Model Pilot, a component of the NIH Big Data to Knowledge (BD2K) program.

Reviewer information

Nature thanks Christian Siebold, Ieva Sutkeviciute, Jean-Pierre Vilardaga and the other anonymous reviewer(s) for their contribution to the peer review of this work.