Machine learning reveals recipe for building artificial proteins