-
Notifications
You must be signed in to change notification settings - Fork 16
/
boolode.py
40 lines (30 loc) · 939 Bytes
/
boolode.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
import yaml
import argparse
import BoolODE as bo
def get_parser():
'''
:return: an argparse ArgumentParser object for parsing command
line parameters
'''
parser = argparse.ArgumentParser(
description='Run BoolODE to generate synthetic scRNAseq data.\n Please specify config file.')
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:
boolodejobs = bo.ConfigParser.parse(conf)
boolodejobs.execute_jobs()
print('Jobs finished')
if __name__ == '__main__':
main()