ThorbenF commited on
Commit
e4000f9
·
1 Parent(s): 50f1c9f

Updated .js and HTML files to dynamically pass sequence to Hugging Face and display scores

Browse files
Files changed (2) hide show
  1. .ipynb_checkpoints/app-checkpoint.py +10 -1
  2. app.py +10 -1
.ipynb_checkpoints/app-checkpoint.py CHANGED
@@ -151,8 +151,17 @@ def fetch_and_display_pdb(pdb_id):
151
  return viewer._make_html()
152
 
153
  # Define the Gradio interface
 
 
 
 
 
 
 
 
 
154
  interface = gr.Interface(
155
- fn=predict_protein_sequence,
156
  inputs=[
157
  gr.Textbox(lines=2, placeholder="Enter protein sequence here...", label="Protein Sequence"),
158
  gr.Textbox(lines=1, placeholder="Enter PDB ID here...", label="PDB ID for 3D Visualization")
 
151
  return viewer._make_html()
152
 
153
  # Define the Gradio interface
154
+ def gradio_interface(sequence, pdb_id):
155
+ # Call the prediction function
156
+ binding_site_predictions = predict_protein_sequence(sequence)
157
+
158
+ # Call the PDB structure visualization function
159
+ pdb_structure_html = fetch_and_display_pdb(pdb_id)
160
+
161
+ return binding_site_predictions, pdb_structure_html
162
+
163
  interface = gr.Interface(
164
+ fn=gradio_interface,
165
  inputs=[
166
  gr.Textbox(lines=2, placeholder="Enter protein sequence here...", label="Protein Sequence"),
167
  gr.Textbox(lines=1, placeholder="Enter PDB ID here...", label="PDB ID for 3D Visualization")
app.py CHANGED
@@ -151,8 +151,17 @@ def fetch_and_display_pdb(pdb_id):
151
  return viewer._make_html()
152
 
153
  # Define the Gradio interface
 
 
 
 
 
 
 
 
 
154
  interface = gr.Interface(
155
- fn=predict_protein_sequence,
156
  inputs=[
157
  gr.Textbox(lines=2, placeholder="Enter protein sequence here...", label="Protein Sequence"),
158
  gr.Textbox(lines=1, placeholder="Enter PDB ID here...", label="PDB ID for 3D Visualization")
 
151
  return viewer._make_html()
152
 
153
  # Define the Gradio interface
154
+ def gradio_interface(sequence, pdb_id):
155
+ # Call the prediction function
156
+ binding_site_predictions = predict_protein_sequence(sequence)
157
+
158
+ # Call the PDB structure visualization function
159
+ pdb_structure_html = fetch_and_display_pdb(pdb_id)
160
+
161
+ return binding_site_predictions, pdb_structure_html
162
+
163
  interface = gr.Interface(
164
+ fn=gradio_interface,
165
  inputs=[
166
  gr.Textbox(lines=2, placeholder="Enter protein sequence here...", label="Protein Sequence"),
167
  gr.Textbox(lines=1, placeholder="Enter PDB ID here...", label="PDB ID for 3D Visualization")