optional cddd embedding
Browse files
app.py
CHANGED
@@ -46,20 +46,30 @@ def about_page():
|
|
46 |
|
47 |
def display_dti():
|
48 |
st.markdown('##')
|
49 |
-
smiles = st.text_input(
|
50 |
|
51 |
if smiles:
|
52 |
mol = Chem.MolFromSmiles(smiles)
|
53 |
mol_img = Chem.Draw.MolToImage(mol)
|
54 |
col1, col2, col3 = st.columns(3)
|
55 |
with col1:
|
56 |
-
st.write(
|
57 |
with col2:
|
58 |
st.image(mol_img, width = 140)
|
59 |
with col3:
|
60 |
-
st.write(
|
61 |
st.markdown('##')
|
62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
|
64 |
def display_protein():
|
65 |
"""
|
|
|
46 |
|
47 |
def display_dti():
|
48 |
st.markdown('##')
|
49 |
+
smiles = st.text_input('Enter the SMILES of the query drug compound', value='CC(=O)OC1=CC=CC=C1C(=O)O', placeholder='CC(=O)OC1=CC=CC=C1C(=O)O')
|
50 |
|
51 |
if smiles:
|
52 |
mol = Chem.MolFromSmiles(smiles)
|
53 |
mol_img = Chem.Draw.MolToImage(mol)
|
54 |
col1, col2, col3 = st.columns(3)
|
55 |
with col1:
|
56 |
+
st.write('')
|
57 |
with col2:
|
58 |
st.image(mol_img, width = 140)
|
59 |
with col3:
|
60 |
+
st.write('')
|
61 |
st.markdown('##')
|
62 |
|
63 |
+
selected_encoder = st.selectbox(
|
64 |
+
'Select encoder for drug compound',('None', 'CDDD')
|
65 |
+
)
|
66 |
+
if selected_encoder == 'CDDD':
|
67 |
+
from cddd.inference import InferenceModel
|
68 |
+
CDDD_MODEL_DIR = 'checkpoints/CDDD/default_model'
|
69 |
+
cddd_model = InferenceModel(CDDD_MODEL_DIR)
|
70 |
+
embedding = cddd_model.seq_to_emb([smiles])
|
71 |
+
st.write(f'CDDD embedding: {embedding}')
|
72 |
+
|
73 |
|
74 |
def display_protein():
|
75 |
"""
|