For decades, scientists have largely relied on painstaking trial and error to coax proteins into crystalline forms.