nninva commited on
Commit
f25aaec
·
verified ·
1 Parent(s): ebd4068

Trying to fix unusable text boxes

Browse files
Files changed (1) hide show
  1. app.py +12 -10
app.py CHANGED
@@ -130,23 +130,25 @@ def predict_affinity(protein_input, protein_type, ligand_input, ligand_type):
130
 
131
  def update_inputs(protein_type, ligand_type):
132
  return (
133
- gr.update(visible=(protein_type == "File")), # Protein file input
134
- gr.update(visible=(protein_type == "FASTA")), # Protein FASTA input
135
- gr.update(visible=(ligand_type == "File")), # Ligand file input
136
- gr.update(visible=(ligand_type == "SMILES")) # Ligand SMILES input
137
  )
138
 
139
  with gr.Blocks() as iface:
140
  gr.Markdown("# Predict Protein-Ligand Binding Affinity")
141
  gr.Markdown("Upload files or enter FASTA/SMILES strings to predict binding affinity.")
142
 
143
- protein_type = gr.Radio(["File", "FASTA"], label="Protein Input Type", value="File")
144
- protein_file = gr.File(label="Protein .pdb file", visible=True)
145
- protein_fasta = gr.Textbox(label="Protein FASTA sequence", visible=False)
146
 
147
- ligand_type = gr.Radio(["File", "SMILES"], label="Ligand Input Type", value="File")
148
- ligand_file = gr.File(label="Ligand .mol2 file", visible=True)
149
- ligand_smiles = gr.Textbox(label="Ligand SMILES string", visible=False)
 
 
150
 
151
  output = gr.Textbox(label="Prediction Result", lines=3)
152
 
 
130
 
131
  def update_inputs(protein_type, ligand_type):
132
  return (
133
+ gr.update(visible=(protein_type == "File"), interactive=(protein_type == "File")), # Protein File
134
+ gr.update(visible=(protein_type == "FASTA"), interactive=(protein_type == "FASTA")), # Protein FASTA
135
+ gr.update(visible=(ligand_type == "File"), interactive=(ligand_type == "File")), # Ligand File
136
+ gr.update(visible=(ligand_type == "SMILES"), interactive=(ligand_type == "SMILES")) # Ligand SMILES
137
  )
138
 
139
  with gr.Blocks() as iface:
140
  gr.Markdown("# Predict Protein-Ligand Binding Affinity")
141
  gr.Markdown("Upload files or enter FASTA/SMILES strings to predict binding affinity.")
142
 
143
+ with gr.Row():
144
+ protein_type = gr.Radio(["File", "FASTA"], label="Protein Input Type", value="File")
145
+ ligand_type = gr.Radio(["File", "SMILES"], label="Ligand Input Type", value="File")
146
 
147
+ protein_file = gr.File(label="Protein .pdb file", visible=True, interactive=True)
148
+ protein_fasta = gr.Textbox(label="Protein FASTA sequence", visible=False, interactive=False)
149
+
150
+ ligand_file = gr.File(label="Ligand .mol2 file", visible=True, interactive=True)
151
+ ligand_smiles = gr.Textbox(label="Ligand SMILES string", visible=False, interactive=False)
152
 
153
  output = gr.Textbox(label="Prediction Result", lines=3)
154