forked from Murali-group/Beeline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BLRunner.py
62 lines (42 loc) · 1.44 KB
/
BLRunner.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env python
# coding: utf-8
import argparse
import time
import yaml
import BLRun as br
yaml.warnings({"YAMLLoadWarning": False})
def get_parser() -> argparse.ArgumentParser:
"""
:return: an argparse ArgumentParser object for parsing command
line parameters
"""
parser = argparse.ArgumentParser(description="Run pathway reconstruction pipeline.")
parser.add_argument("--config", default="config.yaml", help="Path to config file")
return parser
def parse_arguments():
"""
Initialize a parser and use it to parse the command line arguments
:return: parsed dictionary of command line arguments
"""
parser = get_parser()
opts = parser.parse_args()
return opts
def main():
opts = parse_arguments()
config_file = opts.config
with open(config_file, "r") as conf:
evaluation = br.ConfigParser.parse(conf)
# print(evaluation.__dict__)
start_time = time.process_time()
print("Evaluation started")
for idx in range(len(evaluation.runners)):
evaluation.runners[idx].generateInputs()
for idx in range(len(evaluation.runners)):
evaluation.runners[idx].run()
for idx in range(len(evaluation.runners)):
evaluation.runners[idx].parseOutput()
print("Evaluation complete")
end_time = time.process_time()
print(f"Execution of algorithms completed in {end_time-start_time:0.2f} seconds")
if __name__ == "__main__":
main()