woshixuhao
commited on
Commit
·
4ad5fdd
1
Parent(s):
e12edad
Update app.py
Browse files
app.py
CHANGED
@@ -1393,6 +1393,16 @@ Given two compounds and predict the RT in different condition
|
|
1393 |
|
1394 |
|
1395 |
def predict_separate(smile_1, smile_2, input_eluent, input_speed, input_column):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1396 |
speed = []
|
1397 |
eluent = []
|
1398 |
smiles=[smile_1,smile_2]
|
@@ -1475,8 +1485,7 @@ def predict_separate(smile_1, smile_2, input_eluent, input_speed, input_column):
|
|
1475 |
pred, h_graph = model(data_atom_bond.to(device), data_bond_angle.to(device))
|
1476 |
|
1477 |
y_pred.append(pred.detach().cpu().data.numpy() / speed[i])
|
1478 |
-
|
1479 |
-
out_put='Speed cannot be 0!'
|
1480 |
else:
|
1481 |
Sp=cal_prob(y_pred)
|
1482 |
output_1=f'For smile_1,\n the predicted value is: {str(np.round(y_pred[0][0][1],3))}\n'
|
@@ -1487,6 +1496,15 @@ def predict_separate(smile_1, smile_2, input_eluent, input_speed, input_column):
|
|
1487 |
|
1488 |
|
1489 |
def column_recommendation(smile_1, smile_2, input_eluent, input_speed):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1490 |
speed = []
|
1491 |
eluent = []
|
1492 |
Prediction = []
|
@@ -1588,7 +1606,7 @@ def column_recommendation(smile_1, smile_2, input_eluent, input_speed):
|
|
1588 |
|
1589 |
|
1590 |
if __name__=='__main__':
|
1591 |
-
|
1592 |
## Description\n
|
1593 |
It is a app for predicting retention times in HPLC and recommend the best HPLC column type for chromatographic enantioseparation.\n\n
|
1594 |
Input:\n
|
|
|
1393 |
|
1394 |
|
1395 |
def predict_separate(smile_1, smile_2, input_eluent, input_speed, input_column):
|
1396 |
+
if input_speed==None:
|
1397 |
+
out_put='Please input Speed!'
|
1398 |
+
return out_put
|
1399 |
+
if input_speed==0:
|
1400 |
+
out_put='Speed cannot be 0!'
|
1401 |
+
return out_put
|
1402 |
+
if input_eluent==None:
|
1403 |
+
out_put='Please input eluent!'
|
1404 |
+
return out_put
|
1405 |
+
|
1406 |
speed = []
|
1407 |
eluent = []
|
1408 |
smiles=[smile_1,smile_2]
|
|
|
1485 |
pred, h_graph = model(data_atom_bond.to(device), data_bond_angle.to(device))
|
1486 |
|
1487 |
y_pred.append(pred.detach().cpu().data.numpy() / speed[i])
|
1488 |
+
|
|
|
1489 |
else:
|
1490 |
Sp=cal_prob(y_pred)
|
1491 |
output_1=f'For smile_1,\n the predicted value is: {str(np.round(y_pred[0][0][1],3))}\n'
|
|
|
1496 |
|
1497 |
|
1498 |
def column_recommendation(smile_1, smile_2, input_eluent, input_speed):
|
1499 |
+
if input_speed==None:
|
1500 |
+
out_put='Please input Speed!'
|
1501 |
+
return out_put
|
1502 |
+
if input_speed==0:
|
1503 |
+
out_put='Speed cannot be 0!'
|
1504 |
+
return out_put
|
1505 |
+
if input_eluent==None:
|
1506 |
+
out_put='Please input eluent!'
|
1507 |
+
return out_put
|
1508 |
speed = []
|
1509 |
eluent = []
|
1510 |
Prediction = []
|
|
|
1606 |
|
1607 |
|
1608 |
if __name__=='__main__':
|
1609 |
+
model_card = f"""
|
1610 |
## Description\n
|
1611 |
It is a app for predicting retention times in HPLC and recommend the best HPLC column type for chromatographic enantioseparation.\n\n
|
1612 |
Input:\n
|