This work was supported by National Institutes of Health (NIH) grants DP5OD023048 (A.M.), R01GM127359 (R.O.D.) and R01GM102498 (P.A.B.). I.D. acknowledges support from the Swiss National Science Foundation. A.M. acknowledges support from the Pew Charitable Trusts. B.R.M. acknowledges support from the American Cancer Society. N.R.L. and K.J.R. were supported by National Science Foundation Graduate Research Fellowships and K.J.R. by a Gerhard Casper Stanford Graduate Fellowship. The content is solely the responsibility of the authors and does not necessarily represent the official view of the NIH. We thank A. Wang for assistance with simulation setup and analysis. We thank the staff at the GM/CA beamlines at the Advanced Photon Source, which have been funded in whole or in part with federal funds from the National Cancer Institute (ACB-12002) and the National Institute of General Medical Sciences (AGM-12006). This research used resources of the Advanced Photon Source, a US Department of Energy (DOE) Office of Science User Facility operated for the DOE Office of Science by Argonne National Laboratory under Contract No. DE-AC02-06CH11357. The Eiger 16M detector was funded by an NIH–Office of Research Infrastructure Programs, High-End Instrumentation Grant (1S10OD012289-01A1).

Peer review information

Nature thanks Raymond Stevens and the other anonymous reviewer(s) for their contribution to the peer review of this work.