-
Notifications
You must be signed in to change notification settings - Fork 0
/
Snakefile
152 lines (137 loc) · 5.53 KB
/
Snakefile
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
import os
from benchmark import PREFIX_TEMPLATE
from evaluate import OPTIMIZER_FORWARD, N_STARTS_FORWARD
from comparison import MODELS
rule compile_model:
input:
script='compile_petab.py',
output:
module=os.path.join('amici_models', '{model}', '{model}', '{model}.py')
wildcard_constraints:
model=r'[\w_]+'
shell:
'python3 {input.script} {wildcards.model}'
rule run_benchmark_very_long:
input:
model=os.path.join('amici_models', '{model}', '{model}', '{model}.py')
output:
h5=os.path.join('results', PREFIX_TEMPLATE.format(
model='{model}', optimizer='{optimizer}', starts='{starts}'
) + '.hdf5'),
stats=os.path.join('stats', PREFIX_TEMPLATE.format(
model='{model}', optimizer='{optimizer}', starts='{starts}'
) + '__STATS.hdf5')
wildcard_constraints:
model='(Beer_MolBioSystems2014|Isensee_JCB2018|Lucarelli_CellSystems2018)',
shell:
'python3 benchmark.py {wildcards.model} {wildcards.optimizer} '
'{wildcards.starts}'
rule run_benchmark_extended:
input:
model=os.path.join('amici_models', '{model}', '{model}', '{model}.py')
output:
h5=os.path.join('results', PREFIX_TEMPLATE.format(
model='{model}', optimizer='{optimizer}', starts='{starts}'
) + '.hdf5'),
stats=os.path.join('stats', PREFIX_TEMPLATE.format(
model='{model}', optimizer='{optimizer}', starts='{starts}'
) + '__STATS.hdf5')
wildcard_constraints:
model='(Beer_MolBioSystems2014|Isensee_JCB2018|Bachmann_MSB2011|'
'Lucarelli_CellSystems2018|Weber_BMC2015)',
optimizer='(fides\.subspace=2D\.hessian=FX|'
'fides\.subspace=2D\.hessian=GNSBFGS|'
'fides\.subspace=2D\.hessian=SSM|'
'fides\.subspace=2D\.hessian=TSSM|'
'fides\.subspace=2D\.ebounds=1000|'
'fides\.subspace=2D\.ebounds=100|'
'fides\.subspace=2D\.ebounds=Inf)'
shell:
'python3 benchmark.py {wildcards.model} {wildcards.optimizer} '
'{wildcards.starts}'
rule run_benchmark_long:
input:
model=os.path.join('amici_models', '{model}', '{model}', '{model}.py')
output:
h5=os.path.join('results', PREFIX_TEMPLATE.format(
model='{model}', optimizer='{optimizer}', starts='{starts}'
) + '.hdf5'),
stats=os.path.join('stats', PREFIX_TEMPLATE.format(
model='{model}', optimizer='{optimizer}', starts='{starts}'
) + '__STATS.hdf5')
wildcard_constraints:
model='(Bachmann_MSB2011|Weber_BMC2015)'
shell:
'python3 benchmark.py {wildcards.model} {wildcards.optimizer} '
'{wildcards.starts}'
rule run_benchmark_short:
input:
model=os.path.join('amici_models', '{model}', '{model}', '{model}.py')
output:
h5=os.path.join('results', PREFIX_TEMPLATE.format(
model='{model}', optimizer='{optimizer}', starts='{starts}'
) + '.hdf5'),
stats=os.path.join('stats', PREFIX_TEMPLATE.format(
model='{model}', optimizer='{optimizer}', starts='{starts}'
) + '__STATS.hdf5')
wildcard_constraints:
model='(Crauste_CellSystems2017|Boehm_JProteomeRes2014|Bruno_JExpBot2016)'
shell:
'python3 benchmark.py {wildcards.model} {wildcards.optimizer} '
'{wildcards.starts}'
rule run_benchmark:
input:
model=os.path.join('amici_models', '{model}', '{model}', '{model}.py')
output:
h5=os.path.join('results', PREFIX_TEMPLATE.format(
model='{model}', optimizer='{optimizer}', starts='{starts}'
) + '.hdf5'),
stats=os.path.join('stats', PREFIX_TEMPLATE.format(
model='{model}', optimizer='{optimizer}', starts='{starts}'
) + '__STATS.hdf5')
shell:
'python3 benchmark.py {wildcards.model} {wildcards.optimizer} '
'{wildcards.starts}'
rule check_eigenvalues:
input:
script='check_eigenvalues.py',
model=os.path.join('amici_models', '{model}', '{model}', '{model}.py'),
output:
csv=os.path.join('evaluation', '{model}__{optimizer}__{starts}__evs.csv'),
shell:
'python3 {input.script} {wildcards.model} {wildcards.optimizer} '
'{wildcards.starts}'
rule evaluate_subspace_benchmark:
input:
script='evaluate.py',
hdf5=expand(rules.run_benchmark.output.h5,
model=['{model}'], optimizer=OPTIMIZER_FORWARD,
starts=N_STARTS_FORWARD)
output:
full_waterfall=os.path.join('evaluation', '{model}_all_starts.pdf')
shell:
'python3 {input.script} {wildcards.model}'
rule benchmark:
input:
expand(
os.path.join('evaluation', '{model}_all_starts.pdf'),
model=MODELS
)
rule eigenvalues:
input:
expand(rules.check_eigenvalues.output.csv,
model=MODELS,
optimizer=[
'fides.subspace=2D',
'fides.subspace=full',
'fides.subspace=full.hessian=BFGS',
'fides.subspace=2D.hessian=BFGS',
'fides.subspace=full.hessian=SR1',
'fides.subspace=2D.hessian=SR1',
'ls_trf',
'ls_trf_2D',
'fmincon',
'lsqnonlin',
],
starts=N_STARTS_FORWARD)
ruleorder: run_benchmark_extended > run_benchmark_very_long > run_benchmark_long > run_benchmark_short > run_benchmark