Code to reproduce all figures in Helmus et al. 2014 Nature