This study was supported by grants to SBC by the Autism Research Trust, the Medical Research Council, and the Wellcome Trust. This study was conducted using the Danish National Biobank resource supported by the Novo Nordisk Foundation. The research was supported by the National Institute for Health Research (NIHR) Collaboration for Leadership in Applied Health Research and Care East of England at Cambridgeshire and Peterborough NHS Foundation Trust. The views expressed are those of the author(s) and not necessarily those of the NHS, the NIHR or the Department of Health. AP was funded by a doctoral scholarship from Trinity College Cambridge. AT was funded by a doctoral scholarship from Peterhouse Cambridge. This study also benefitted from support from the NIHR Cambridge Biomedical Research Centre and the Templeton World Charitable Foundation.