forked from sanmitraghosh/hergModels
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
36 lines (31 loc) · 1.17 KB
/
run.py
File metadata and controls
36 lines (31 loc) · 1.17 KB
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
#!/usr/bin/env python3
#
# Fit all model to Cell 5 data using CMA-ES and MCMC
import argparse
import subprocess
#
# Check whether to run optimisation or MCMC
#
parser = argparse.ArgumentParser(
description='Fit all the hERG models to sine wave data')
parser.add_argument('--mode', type=int, default=1, metavar='N',
help='optimisation: 1, AP predictions 2, MCMC: 3, ModelStats: 4')
args = parser.parse_args()
if args.mode == 1:
for i in xrange(30):
bashCommand = 'python cmaesfit.py --cell 5 --model ' + str(i+1)
process = subprocess.Popen(bashCommand.split(), stdout=subprocess.PIPE)
output, error = process.communicate()
print(output)
elif args.mode == 2:
bashCommand = 'python make_predictions.py --cell 5'
process = subprocess.Popen(bashCommand.split(), stdout=subprocess.PIPE)
output, error = process.communicate()
print(output)
elif args.mode == 3:
for i in xrange(30):
bashCommand = 'python sinemcmc.py --cell 5 --model ' + \
str(i+1)
process = subprocess.Popen(bashCommand.split(), stdout=subprocess.PIPE)
output, error = process.communicate()
print(output)