|
import gradio as gr |
|
|
|
|
|
def predict_stability(pdb_file=None, sequence=None): |
|
|
|
return "Predicted Stability: Example Output" |
|
|
|
|
|
with gr.Blocks() as demo: |
|
gr.Markdown( |
|
""" |
|
# PLTNUM: Protein LifeTime Neural Model |
|
**Predict the protein half-life from its sequence or PDB file.** |
|
""" |
|
) |
|
gr.MarkDown("![model image](https://github.com/sagawatatsuya/PLTNUM/blob/main/model-image.png)") |
|
|
|
model_choice = gr.Radio(choices=["SaProt", "ESM-2"], label="Select PLTNUM's base model.", value="SaProt") |
|
|
|
with gr.Tabs(): |
|
with gr.TabItem("Upload PDB File"): |
|
gr.Markdown("### Upload your PDB file:") |
|
pdb_file = gr.File(label="Upload PDB File") |
|
predict_button = gr.Button("Predict Stability") |
|
prediction_output = gr.Textbox(label="Stability Prediction", interactive=False) |
|
|
|
predict_button.click(fn=predict_stability, inputs=pdb_file, outputs=prediction_output) |
|
|
|
with gr.TabItem("Enter Protein Sequence"): |
|
gr.Markdown("### Enter the protein sequence:") |
|
sequence = gr.Textbox( |
|
label="Protein Sequence", |
|
placeholder="Enter your protein sequence here...", |
|
lines=8, |
|
) |
|
predict_button = gr.Button("Predict Stability") |
|
prediction_output = gr.Textbox(label="Stability Prediction", interactive=False) |
|
|
|
predict_button.click(fn=predict_stability, inputs=sequence, outputs=prediction_output) |
|
|
|
with gr.Row(): |
|
gr.Markdown( |
|
""" |
|
### How to Use: |
|
- **Upload PDB File**: Choose the 'Upload PDB File' tab and upload your file. |
|
- **Enter Sequence**: Alternatively, switch to the 'Enter Protein Sequence' tab and input your sequence. |
|
- **Predict**: Click 'Predict Stability' to receive the prediction. |
|
""" |
|
) |
|
|
|
gr.Markdown( |
|
""" |
|
### About the Tool |
|
This tool allows researchers and scientists to predict the stability of proteins using advanced algorithms. It supports both PDB file uploads and direct sequence input. |
|
""" |
|
) |
|
|
|
demo.launch() |
|
|