-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.py
41 lines (33 loc) · 1.25 KB
/
run.py
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
import argparse
import os
import nanome
from plugin.Docking import Autodock4Docking, SminaDocking
default_algorithm = os.environ.get('ALGORITHM', 'smina').lower()
default_algorithm = os.environ.get('ALGORITHM', 'smina').lower()
def main():
parser = argparse.ArgumentParser(description='Parse Arguments to determine flavor of Docking to instantiate')
parser.add_argument(
'--algorithm',
choices=['smina', 'autodock4'],
default=default_algorithm,
help='Docking algorithm to use')
args, _ = parser.parse_known_args()
plugin_class = None
name = ''
algo = args.algorithm
if algo == "smina":
name = "Smina"
plugin_class = SminaDocking
elif algo == "autodock4":
name = "Autodock4"
plugin_class = Autodock4Docking
# Create the plugin, register Docking as the class to instantiate, and start listening
plugin_name = f'{name} Docking'
description = f'Run docking using {plugin_name}. Lets user choose the ligands, receptor, and docking site.'
category = "Docking"
advanced_settings = True
plugin = nanome.Plugin(plugin_name, description, category, advanced_settings)
plugin.set_plugin_class(plugin_class)
plugin.run()
if __name__ == "__main__":
main()