update comments for planned future functionalities
Browse files
app.py
CHANGED
@@ -42,12 +42,16 @@ def about_page():
|
|
42 |
a given protein target. We demonstrate state-of-the-art performance over previous methods on multiple
|
43 |
well-known benchmarks, particularly in zero-shot settings for unseen protein targets.
|
44 |
"""
|
45 |
-
#st.image('hyper-dti.png') todo
|
46 |
)
|
47 |
|
|
|
48 |
|
49 |
-
|
50 |
-
|
|
|
|
|
|
|
|
|
51 |
col1, col2 = st.columns(2)
|
52 |
|
53 |
with col1:
|
@@ -105,12 +109,6 @@ def display_dti():
|
|
105 |
for emb in embeddings:
|
106 |
embedding = encoder.reduce_per_protein(emb)
|
107 |
break
|
108 |
-
#from huggingface_hub import hf_hub_download
|
109 |
-
#precomputed_embs = f'{selected_encoder}_encoding.csv'
|
110 |
-
#REPO_ID = "emmas96/Lenselink"
|
111 |
-
#embs_path = hf_hub_download(REPO_ID, precomputed_embs)
|
112 |
-
#embs = pd.read_csv(embs_path)
|
113 |
-
#embedding = embs[sequence]
|
114 |
elif selected_encoder == 'UniRep':
|
115 |
from jax_unirep.utils import load_params
|
116 |
params = load_params()
|
@@ -138,8 +136,13 @@ def display_dti():
|
|
138 |
st.write(f'{selected_encoder} embedding')
|
139 |
st.write(embedding)
|
140 |
|
|
|
|
|
|
|
141 |
def retrieval():
|
142 |
-
st.markdown('##')
|
|
|
|
|
143 |
|
144 |
st.markdown('### Target')
|
145 |
sequence = st.text_input('Enter the amino-acid sequence of the query protein target', value='HXHVWPVQDAKARFSEFLDACITEGPQIVSRRGAEEAVLVPIGEWRRLQAAA', placeholder='HXHVWPVQDAKARFSEFLDACITEGPQIVSRRGAEEAVLVPIGEWRRLQAAA')
|
@@ -148,10 +151,28 @@ def retrieval():
|
|
148 |
st.markdown('\n\n\n\n Plot of protein to be added soon. \n\n\n\n')
|
149 |
|
150 |
selected_encoder = st.selectbox(
|
151 |
-
'Select encoder for protein target',('
|
152 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
|
154 |
-
st.
|
155 |
col1, col2, col3, col4, col5 = st.columns(5)
|
156 |
with col1:
|
157 |
smiles = 'CC(=O)OC1=CC=CC=C1C(=O)O'
|
@@ -185,7 +206,8 @@ def retrieval():
|
|
185 |
|
186 |
|
187 |
def display_protein():
|
188 |
-
st.markdown('##')
|
|
|
189 |
|
190 |
st.markdown('### Target')
|
191 |
sequence = st.text_input('Enter the amino-acid sequence of the query protein target', value='HXHVWPVQDAKARFSEFLDACITEGPQIVSRRGAEEAVLVPIGEWRRLQAAA', placeholder='HXHVWPVQDAKARFSEFLDACITEGPQIVSRRGAEEAVLVPIGEWRRLQAAA')
|
@@ -269,11 +291,26 @@ def display_protein():
|
|
269 |
# example proteins ["HXHVWPVQDAKARFSEFLDACITEGPQIVSRRGAEEAVLVPIGEWRRLQAAA"], ["AHKLFIGGLPNYLNDDQVKELLTSFGPLKAFNLVKDSATGLSKGYAFCEYVDINVTDQAIAGLNGMQLGDKKLLVQRASVGAKNA"]
|
270 |
"""
|
271 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
272 |
page_names_to_func = {
|
273 |
'About': about_page,
|
274 |
-
'
|
275 |
'Retrieve Top-k': retrieval,
|
276 |
-
'
|
|
|
|
|
277 |
}
|
278 |
|
279 |
selected_page = st.sidebar.selectbox('Choose function', page_names_to_func.keys())
|
|
|
42 |
a given protein target. We demonstrate state-of-the-art performance over previous methods on multiple
|
43 |
well-known benchmarks, particularly in zero-shot settings for unseen protein targets.
|
44 |
"""
|
|
|
45 |
)
|
46 |
|
47 |
+
st.image('hyper-dti.png')
|
48 |
|
49 |
+
|
50 |
+
def predict_dti():
|
51 |
+
st.markdown('## Predict drug-target interaction')
|
52 |
+
|
53 |
+
st.write('In the future this page will display the predicted interaction betweek the given drug compounds and protein target by the HyperPCM mdoel.')
|
54 |
+
|
55 |
col1, col2 = st.columns(2)
|
56 |
|
57 |
with col1:
|
|
|
109 |
for emb in embeddings:
|
110 |
embedding = encoder.reduce_per_protein(emb)
|
111 |
break
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
elif selected_encoder == 'UniRep':
|
113 |
from jax_unirep.utils import load_params
|
114 |
params = load_params()
|
|
|
136 |
st.write(f'{selected_encoder} embedding')
|
137 |
st.write(embedding)
|
138 |
|
139 |
+
st.write('TODO run inference with HyperPCM on the given drug compound and protein target.')
|
140 |
+
|
141 |
+
|
142 |
def retrieval():
|
143 |
+
st.markdown('## Retrieve top-k')
|
144 |
+
|
145 |
+
st.write('In the furute this page will retrieve the top-k drug compounds that are predicted to have the highest activity toward the given protein target from either the Lenselink or Davis datasets.')
|
146 |
|
147 |
st.markdown('### Target')
|
148 |
sequence = st.text_input('Enter the amino-acid sequence of the query protein target', value='HXHVWPVQDAKARFSEFLDACITEGPQIVSRRGAEEAVLVPIGEWRRLQAAA', placeholder='HXHVWPVQDAKARFSEFLDACITEGPQIVSRRGAEEAVLVPIGEWRRLQAAA')
|
|
|
151 |
st.markdown('\n\n\n\n Plot of protein to be added soon. \n\n\n\n')
|
152 |
|
153 |
selected_encoder = st.selectbox(
|
154 |
+
'Select encoder for protein target',('SeqVec')
|
155 |
)
|
156 |
+
from bio_embeddings.embed import SeqVecEmbedder
|
157 |
+
encoder = SeqVecEmbedder()
|
158 |
+
embeddings = encoder.embed_batch([sequence])
|
159 |
+
for emb in embeddings:
|
160 |
+
embedding = encoder.reduce_per_protein(emb)
|
161 |
+
break
|
162 |
+
|
163 |
+
st.write('TODO HyperPCM predicts the QSAR model for the given protein target.')
|
164 |
+
|
165 |
+
col1, col2 = st.columns(2)
|
166 |
+
with col1:
|
167 |
+
selected_dataset = st.selectbox(
|
168 |
+
'Select dataset from which the drug compounds should be retrieved',('Lenselink', 'Davis')
|
169 |
+
)
|
170 |
+
with col2:
|
171 |
+
selected_k = st.selectbox(
|
172 |
+
'Select the top-k number of drug compounds to retrieve',(5, 10, 15, 20)
|
173 |
+
)
|
174 |
|
175 |
+
st.write(f'The top-{selected_k} most active drug coupounds from {selected_dataset} predicted by HyperPCM are: ')
|
176 |
col1, col2, col3, col4, col5 = st.columns(5)
|
177 |
with col1:
|
178 |
smiles = 'CC(=O)OC1=CC=CC=C1C(=O)O'
|
|
|
206 |
|
207 |
|
208 |
def display_protein():
|
209 |
+
st.markdown('## Display protein')
|
210 |
+
st.write('In the future this page will display the ESM predicted sequence of a protein target.')
|
211 |
|
212 |
st.markdown('### Target')
|
213 |
sequence = st.text_input('Enter the amino-acid sequence of the query protein target', value='HXHVWPVQDAKARFSEFLDACITEGPQIVSRRGAEEAVLVPIGEWRRLQAAA', placeholder='HXHVWPVQDAKARFSEFLDACITEGPQIVSRRGAEEAVLVPIGEWRRLQAAA')
|
|
|
291 |
# example proteins ["HXHVWPVQDAKARFSEFLDACITEGPQIVSRRGAEEAVLVPIGEWRRLQAAA"], ["AHKLFIGGLPNYLNDDQVKELLTSFGPLKAFNLVKDSATGLSKGYAFCEYVDINVTDQAIAGLNGMQLGDKKLLVQRASVGAKNA"]
|
292 |
"""
|
293 |
|
294 |
+
def display_context():
|
295 |
+
st.markdown('## Display context')
|
296 |
+
st.write('In the future this page will visualize the context module for a given protein, i.e., show important features and highly ranked / related proteins from the context.')
|
297 |
+
|
298 |
+
def references():
|
299 |
+
st.markdown(
|
300 |
+
'''
|
301 |
+
## References
|
302 |
+
|
303 |
+
This page will contain all references to related work.
|
304 |
+
'''
|
305 |
+
)
|
306 |
+
|
307 |
page_names_to_func = {
|
308 |
'About': about_page,
|
309 |
+
'Predict DTI': predict_dti,
|
310 |
'Retrieve Top-k': retrieval,
|
311 |
+
'Display Protein': display_protein,
|
312 |
+
'Display Context': display_context,
|
313 |
+
'References': references
|
314 |
}
|
315 |
|
316 |
selected_page = st.sidebar.selectbox('Choose function', page_names_to_func.keys())
|