File size: 1,013 Bytes
6daa4cc
 
7fc9185
6daa4cc
7fc9185
6daa4cc
7fc9185
 
6daa4cc
28fb149
 
 
e533974
 
7fc9185
e533974
6daa4cc
e533974
 
 
6daa4cc
 
 
 
 
 
 
e533974
6daa4cc
e533974
6daa4cc
7fc9185
 
6daa4cc
 
 
7fc9185
28fb149
6daa4cc
 
e533974
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import logging
import os.path

import gradio as gr

import run_utils


def run_wrapper(protein_file, ligand_file, *args, **kwargs) -> str:
    return run_utils.run_cli_command(
        protein_file.name, ligand_file.name, *args, **kwargs
    )


def run():
    iface = gr.Interface(
        fn=run_wrapper,
        inputs=[
            gr.File(label="Protein PDB", file_types=[".pdb"]),
            gr.File(label="Ligand SDF", file_types=[".sdf"]),
            gr.Number(
                label="Samples Per Complex",
                value=1,
                minimum=1,
                maximum=100,
                precision=0,
            ),
            gr.Checkbox(label="Keep Local Structures", value=True),
            gr.Checkbox(label="Save Visualisation", value=True),
        ],
        outputs=gr.File(label="Result"),
    )

    iface.launch(server_name="0.0.0.0", server_port=7860, share=False)


if __name__ == "__main__":
    run_utils.set_env_variables()
    run_utils.configure_logging()

    run()