Spaces:
Sleeping
Sleeping
Trying to fix unusable text boxes
Browse files
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
|
| 134 |
-
gr.update(visible=(protein_type == "FASTA")), # Protein FASTA
|
| 135 |
-
gr.update(visible=(ligand_type == "File")), # Ligand
|
| 136 |
-
gr.update(visible=(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 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
|
|
|
|
|
|
| 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 |
|