dataset_info:
features:
- name: PDB_ID
dtype: string
- name: Entity_ID
dtype: string
- name: Chain
dtype: string
- name: Length
dtype: int16
- name: Fmax_eps-over-A
dtype: float32
- name: Fmax_pN
dtype: float32
- name: Dmax_A
dtype: float32
- name: Lmax_A
dtype: float32
- name: Lambda
dtype: float32
- name: Sequence
dtype: string
splits:
- name: train
num_bytes: 3212304
num_examples: 16652
- name: test
num_bytes: 21731
num_examples: 124
download_size: 2217065
dataset_size: 3234035
configs:
- config_name: default
data_files:
- split: train
path: data/train-*
- split: test
path: data/test-*
PRESTO: Rapid protein mechanical strength prediction with an end-to-end deep learning model
Proteins often form biomaterials with exceptional mechanical properties equal or even superior to synthetic materials. Currently, using experimental atomic force microscopy or computational molecular dynamics to evaluate protein mechanical strength remains costly and time-consuming, limiting large-scale de novo protein investigations. Therefore, there exists a growing demand for fast and accurate prediction of protein mechanical strength. To address this challenge, we propose PRESTO, a rapid end-to-end deep learning (DL) model to predict protein resistance to pulling directly from its sequence. By integrating a natural language processing model with simulation-based protein stretching data, we first demonstrate that PRESTO can accurately predict the maximal pulling force, for given protein sequences with unprecedented efficiency, bypassing the costly steps of conventional methods. Enabled by this rapid prediction capacity, we further find that PRESTO can successfully identify specific mutation locations that may greatly influence protein strength in a biologically plausible manner, such as at the center of polyalanine regions. Finally, we apply our method to design de novo protein sequences by randomly mixing two known sequences at varying ratios. Interestingly, the model predicts that the strength of these mixed proteins follows up- or down-opening “banana curves”, constructing a protein strength curve that breaks away from the general linear law of mixtures. By discovering key insights and suggesting potential optimal sequences, we demonstrate the versatility of PRESTO primarily as a screening tool in a rapid protein design pipeline. Thereby our model may offer new pathways for protein material research that requires analysis and testing of large-scale novel protein sets, as a discovery tool that can be complemented with other modeling methods, and ultimately, experimental synthesis and testing.
Data, model and training
Load data
import math
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.preprocessing import StandardScaler
from datasets import load_dataset
ds = load_dataset("lamm-mit/PRESTO-protein-force", split="train")
protein_df = ds.to_pandas()
print(protein_df.columns)
Scale data
y_data = np.array(protein_df.Fmax_pN.values)
plt.scatter(range(y_data.shape[0]),y_data,s=2)
plt.xlabel('Sequence Number')
plt.ylabel('${F_{max}} (pN)$')
plt.savefig('data_view.png',dpi=500)
scalar=StandardScaler()
y_data_temp=np.reshape(y_data,(y_data.shape[0],1))
fit_data=scalar.fit(y_data_temp)
mean=fit_data.mean_[0]
std=math.sqrt(fit_data.var_)
Y=scalar.fit_transform(y_data_temp)
Define tokenizer and model
# maximum length of sequence, longer the sequences, more time we need -
max_length = 300
from tensorflow.keras.preprocessing.text import Tokenizer
tokenizer = Tokenizer(char_level=True)
tokenizer.fit_on_texts(seqs)
X = tokenizer.texts_to_sequences(seqs)
# if AA seq is longer than max_lenght will be discarded
X = sequence.pad_sequences(X, maxlen=max_length)
Split train/test
X_train, X_test, y_train, y_test = train_test_split(X, Y, test_size=.2,random_state=23)
Define model
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Conv1D, Flatten
from tensorflow.keras.layers import Dropout
from tensorflow.keras.layers import Embedding
model = Sequential()
model.add(Embedding(len(tokenizer.word_index)+1, embedding_dim, input_length=max_length))
model.add(Conv1D(filters=64, kernel_size=3, padding='same', activation='relu'))
model.add(Conv1D(filters=32, kernel_size=3, padding='same', activation='relu'))
model.add(tf.keras.layers.Bidirectional(keras.layers.LSTM(units=32,return_sequences=True)))
model.add(tf.keras.layers.Bidirectional(keras.layers.LSTM(units=16,return_sequences=True)))
model.add(Flatten())
model.add(Dropout(0.5))
model.add(Dense(32, activation='relu'))
model.add(Dense(1, activation='linear'))
model.compile(loss='mean_squared_error', optimizer='adam')
Train model
hist=model.fit(X_train, y_train, validation_data=(X_test, y_test), epochs=100, batch_size=128)
model.save('PRESTO.h5')
Plots
from tensorflow.keras.models import load_model
import itertools
model=load_model('PRESTO.h5')
y_train_pred = model.predict(X_train)
y_test_pred = model.predict(X_test)
plt.title('Sequence-to-Feature Model')
plt.scatter(y_train,y_train_pred,s=2)
plt.scatter(y_test,y_test_pred,c='r',s=2)
plt.xlabel('BSDB ${F_{max}}$ (pN)')
plt.ylabel('ML ${F_{max}}$ (pN)')
plt.legend(['training', 'validation'])
plt.savefig('train_comp.png',dpi=500)
Optimization examples
Fitness function
def objective_value(input_seqs,fitness_fcn):
tmp=tokenizer.texts_to_sequences(input_seqs)
temp=sequence.pad_sequences(tmp, maxlen=max_length)
y_pred=fitness_fcn.predict(temp)
return y_pred
def iterate_mutate_no_target(sequences, targeta):
list_list_seq = []
for x in range(len(sequences)):
list_list_seq.append(mutate_no_target(sequences[x], targeta))
return list_list_seq
def iterate_calc(sequences):
list_list_seq = []
for x in sequences:
list_list_seq.append((objective_value(x,fitness_fcn)*std+mean).flatten())
return list_list_seq
Sample sequences
prot_2c7w = 'HQRKVVSWIDVYTRATCQPREVVVPLTVELMGTVAKQLVPSCVTVQRCGGCCPDDGLECVPTGQHQVRMQILMIRYPSSQLGEMSLEEHSQCECRPKKK'
prot_2g38 = 'MSFVITNPEALTVAATEVRRIRDRAIQSDAQVAPMTTAVRPPAADLVSEKAATFLVEYARKYRQTIAAAAVVLEEFAHALTTGADKYATAEADNIKTFS'
prot_2g38_mut = 'MSFVITNPEALTVAATCVRRIRDRAIQSDAQGAPMTTAVRPCADLVSCGGACCFLGEYACKYGQTIAAAAVVLEEFAHALTTGADKYATAEACNCKTFS'
prot_1yn4= 'GKHTVPYTISVDGITALHRTYFVFPENKKVLYQEIDSKVKNELASQRGVTTEKINNAQTATYTLTLNDGNKKVVNLKKNDDAKNSIDPSTIKQIQIVVK'
prot_1kat= 'HHEVVKFMDVYQRSYCHPIETLVDIFQEYPDEIEYIFKPSCVPLMRCGGCCNDEGLECVPTEESNITMQIMRIKPHQGQHIGEMSFLQHNKCECRPKKD'
prot_1bmp= 'STGSKQRSQNRSKTPKNQEALRMANVAENSSSDQRQACKKHELYVSFRDLGWQDWIIAPEGYAAYYCEGECAFPLNSYMNATNHAIVQTLVHFINPETVPKPCCAPTQLNAISVLYFDDSSNVILKKYRNMVVRACGCH'
prot_1cdc= 'RDSGTVWGALGHGINLNIPNFQMTDDIDEVRWERGSTLVAEFKRKMKPFLKSGAFEILANGDLKIKNLTRDDSGTYNVTVYSTNGTRILDKALDLRILE'
#mutates seq into poly-X (change AA and color)
ori = 'MNIFEMLRIDEGLRLKIYLDKAIGRNRAALVNLVFQIGETAAAAAAAAAAAAAAAAAAGAAGFTNSLRYLQQKRWDEAAVNFAKSRWYNQTPNRAKRIAAAAAAAAAAAAAAAAAAITVFRTGTWDAYKNL'
AA='T'
color='orange'
multiple_ori = []
mutated_seqs=[]
mutated_seqs_fmax=[]
num=100
for i in range(num):
multiple_ori.append(ori)
mutated_seqs = iterate_mutate_no_target(multiple_ori, AA)
mutated_seqs_fmax = iterate_calc(mutated_seqs)
pd.DataFrame(mutated_seqs).to_csv("mutations_"+AA+".csv")
np.savetxt('mutations_'+AA+'_fmax.csv', mutated_seqs_fmax, delimiter=',')
for y in mutated_seqs_fmax:
plt.plot(y,'0.7', zorder=0, linewidth=0.4)
transposed=np.transpose(mutated_seqs_fmax)
transposed_mean=[]
transposed_sd=[]
for x in transposed:
transposed_mean.append(np.mean(x))
transposed_sd.append(np.std(x))
Plot results
plt.errorbar(range(len(transposed_mean)),transposed_mean,transposed_sd,capsize=2,zorder=50,color=color)
plt.xlabel('Number of mutations')
plt.ylabel('${F_{max}}$ (pN)')
plt.title(str(num)+' 1p3n sequences mutate towards poly-'+AA)
plt.plot(0,mutated_seqs_fmax[0][0],'or',zorder=100)
plt.plot(len(mutated_seqs[0])-1,mutated_seqs_fmax[0][len(mutated_seqs_fmax[0])-1],'or',zorder=100)
plt.savefig('mutations_'+AA+'.png',dpi=500)
Sample results
Reference
@article{liu2022presto,
title = {{PRESTO}: Rapid protein mechanical strength prediction with an end-to-end deep learning model},
author = {Liu, Frank Y. C. and Ni, Bo and Buehler, Markus J.},
journal = {Extreme Mechanics Letters},
volume = {55},
pages = {101803},
year = {2022},
publisher = {Elsevier},
doi = {10.1016/j.eml.2022.101803},
}




