Skip to content

Commit 939ae86

Browse files
authored
Fix blasi select measurements (#158)
1 parent 52fdffb commit 939ae86

2 files changed

Lines changed: 259 additions & 20 deletions

File tree

Benchmark-Models/Blasi_CellSystems2016/petab_select/03_create_petab.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
UPPER_BOUND,
2525
NOMINAL_VALUE,
2626
ESTIMATE,
27+
TIME_STEADY_STATE,
2728
)
2829

2930

@@ -39,7 +40,7 @@
3940

4041

4142
petab_problem0 = petab.Problem.from_yaml('../Blasi_CellSystems2016.yaml')
42-
measurements0 = dict(zip(petab_problem0.measurement_df[OBSERVABLE_ID], petab_problem0.measurement_df[MEASUREMENT]))
43+
measurements0_grouped = {k: v for k, v in petab_problem0.measurement_df.groupby(OBSERVABLE_ID)}
4344

4445
condition_id = 'condition'
4546
noise = 'sigma'
@@ -69,23 +70,24 @@ def convert_observable_id(id0: str) -> str:
6970
# Create observables
7071
observable_dicts = []
7172
observable_id_mapping = {}
72-
observable_ids0 = sorted(set(measurements0))
73+
observable_ids0 = sorted(set(measurements0_grouped))
7374
for observable_id0 in observable_ids0:
7475
observable_dict = convert_observable_id(observable_id0)
75-
observable_id_mapping[observable_id0] = observable_dict[OBSERVABLE_ID]
76+
observable_id_mapping[observable_dict[OBSERVABLE_ID]] = observable_id0
7677
observable_dicts.append(observable_dict)
7778

7879
# Create measurements
7980
measurement_dicts = []
80-
for observable_id0, value0 in measurements0.items():
81-
observable_id = observable_id_mapping[observable_id0]
82-
measurement_dict = {
83-
OBSERVABLE_ID: observable_id,
84-
SIMULATION_CONDITION_ID: condition_id,
85-
TIME: 'inf',
86-
MEASUREMENT: value0,
87-
}
88-
measurement_dicts.append(measurement_dict)
81+
for observable_id in sorted(observable_id_mapping):
82+
measurements0 = measurements0_grouped[observable_id_mapping[observable_id]]
83+
for _, row0 in measurements0.iterrows():
84+
measurement_dict = {
85+
OBSERVABLE_ID: observable_id,
86+
SIMULATION_CONDITION_ID: condition_id,
87+
TIME: TIME_STEADY_STATE,
88+
MEASUREMENT: row0.measurement,
89+
}
90+
measurement_dicts.append(measurement_dict)
8991

9092
# Create parameters
9193
parameter_dicts = []
Lines changed: 245 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,253 @@
11
observableId simulationConditionId time measurement
2+
observable_x_0ac condition inf 0.7477507546
3+
observable_x_0ac condition inf 0.7488324989
4+
observable_x_0ac condition inf 0.7464186187
5+
observable_x_0ac condition inf 0.7460197371
6+
observable_x_0ac condition inf 0.7346777456
7+
observable_x_0ac condition inf 0.7473683449
8+
observable_x_0ac condition inf 0.7115299516
9+
observable_x_0ac condition inf 0.7041180268
10+
observable_x_0ac condition inf 0.687133716
11+
observable_x_0ac condition inf 0.7043109811
12+
observable_x_0ac condition inf 0.6877183143
13+
observable_x_0ac condition inf 0.722193168
14+
observable_x_0ac condition inf 0.7346053206
15+
observable_x_0ac condition inf 0.7317104869
16+
observable_x_0ac condition inf 0.7368055433
17+
observable_x_0ac condition inf 0.7353015316
18+
observable_x_0ac condition inf 0.7860370077
219
observable_x_0ac condition inf 0.7730402558
20+
observable_x_4ac condition inf 0.0025586787
21+
observable_x_4ac condition inf 0.0025276712
22+
observable_x_4ac condition inf 0.0032089475
23+
observable_x_4ac condition inf 0.0026968148
24+
observable_x_4ac condition inf 0.0035432949
25+
observable_x_4ac condition inf 0.0032944225
26+
observable_x_4ac condition inf 0.0032371439
27+
observable_x_4ac condition inf 0.0038015215
28+
observable_x_4ac condition inf 0.0068750527
29+
observable_x_4ac condition inf 0.0056489969
30+
observable_x_4ac condition inf 0.0049831642
31+
observable_x_4ac condition inf 0.0033456395
32+
observable_x_4ac condition inf 0.0035895127
33+
observable_x_4ac condition inf 0.0027663549
34+
observable_x_4ac condition inf 0.0030647938
35+
observable_x_4ac condition inf 0.0031698565
36+
observable_x_4ac condition inf 0.0017445951
37+
observable_x_4ac condition inf 0.0014080101
38+
observable_x_k05 condition inf 0.0357434956
39+
observable_x_k05 condition inf 0.0299751007
40+
observable_x_k05 condition inf 0.0319485374
41+
observable_x_k05 condition inf 0.0356067978
42+
observable_x_k05 condition inf 0.0358038875
43+
observable_x_k05 condition inf 0.0338619565
44+
observable_x_k05 condition inf 0.032286999
45+
observable_x_k05 condition inf 0.0386392741
46+
observable_x_k05 condition inf 0.0298921207
47+
observable_x_k05 condition inf 0.0344702628
48+
observable_x_k05 condition inf 0.035647086
49+
observable_x_k05 condition inf 0.0416663478
50+
observable_x_k05 condition inf 0.0364716656
51+
observable_x_k05 condition inf 0.0357468678
52+
observable_x_k05 condition inf 0.037757738
53+
observable_x_k05 condition inf 0.035665225
54+
observable_x_k05 condition inf 0.0328347091
355
observable_x_k05 condition inf 0.0301433562
4-
observable_x_k08 condition inf 0.0306241172
5-
observable_x_k12 condition inf 0.0623801676
6-
observable_x_k16 condition inf 0.0341717472
56+
observable_x_k05k08 condition inf 0.0056806576
57+
observable_x_k05k08 condition inf 0.0051190482
58+
observable_x_k05k08 condition inf 0.0064222373
59+
observable_x_k05k08 condition inf 0.006415159
60+
observable_x_k05k08 condition inf 0.0071723039
61+
observable_x_k05k08 condition inf 0.0053909205
62+
observable_x_k05k08 condition inf 0.0070625017
63+
observable_x_k05k08 condition inf 0.0055944146
64+
observable_x_k05k08 condition inf 0.0062533439
65+
observable_x_k05k08 condition inf 0.0060135768
66+
observable_x_k05k08 condition inf 0.0073291191
67+
observable_x_k05k08 condition inf 0.0063897149
68+
observable_x_k05k08 condition inf 0.0065985939
69+
observable_x_k05k08 condition inf 0.0066172451
70+
observable_x_k05k08 condition inf 0.0063324372
71+
observable_x_k05k08 condition inf 0.006899493
72+
observable_x_k05k08 condition inf 0.0038748389
773
observable_x_k05k08 condition inf 0.0037448182
8-
observable_x_k05k12 condition inf 0.0388013075
9-
observable_x_k08k12 condition inf 0.0060419851
10-
observable_x_k08k16 condition inf 0.0035808013
11-
observable_x_k12k16 condition inf 0.0061287628
74+
observable_x_k05k08k12 condition inf 0.0053520976
75+
observable_x_k05k08k12 condition inf 0.0057590151
76+
observable_x_k05k08k12 condition inf 0.0060147152
77+
observable_x_k05k08k12 condition inf 0.0060189639
78+
observable_x_k05k08k12 condition inf 0.006159812
79+
observable_x_k05k08k12 condition inf 0.0060299617
80+
observable_x_k05k08k12 condition inf 0.0063920421
81+
observable_x_k05k08k12 condition inf 0.0063868816
82+
observable_x_k05k08k12 condition inf 0.0087433859
83+
observable_x_k05k08k12 condition inf 0.0084438032
84+
observable_x_k05k08k12 condition inf 0.0086304264
85+
observable_x_k05k08k12 condition inf 0.0071407069
86+
observable_x_k05k08k12 condition inf 0.0075398194
87+
observable_x_k05k08k12 condition inf 0.0057483973
88+
observable_x_k05k08k12 condition inf 0.006949499
89+
observable_x_k05k08k12 condition inf 0.0066482447
90+
observable_x_k05k08k12 condition inf 0.0045629576
1291
observable_x_k05k08k12 condition inf 0.0036498681
92+
observable_x_k05k08k16 condition inf 0.001472112
93+
observable_x_k05k08k16 condition inf 0.00135098
94+
observable_x_k05k08k16 condition inf 0.0010207226
95+
observable_x_k05k08k16 condition inf 0.0016467234
96+
observable_x_k05k08k16 condition inf 0.0012858873
97+
observable_x_k05k08k16 condition inf 0.0010164515
98+
observable_x_k05k08k16 condition inf 0.0021626724
99+
observable_x_k05k08k16 condition inf 0.0014689669
100+
observable_x_k05k08k16 condition inf 0.0015825669
101+
observable_x_k05k08k16 condition inf 0.001479875
102+
observable_x_k05k08k16 condition inf 0.0013319473
103+
observable_x_k05k08k16 condition inf 0.0015379107
104+
observable_x_k05k08k16 condition inf 0.0011180796
105+
observable_x_k05k08k16 condition inf 0.0011762112
106+
observable_x_k05k08k16 condition inf 0.0012530127
107+
observable_x_k05k08k16 condition inf 0.0009777025
108+
observable_x_k05k08k16 condition inf 0.0007228267
13109
observable_x_k05k08k16 condition inf 0.0010327739
110+
observable_x_k05k12 condition inf 0.0434158865
111+
observable_x_k05k12 condition inf 0.0443789052
112+
observable_x_k05k12 condition inf 0.0470881206
113+
observable_x_k05k12 condition inf 0.0477700658
114+
observable_x_k05k12 condition inf 0.0600586224
115+
observable_x_k05k12 condition inf 0.0578341883
116+
observable_x_k05k12 condition inf 0.0571466513
117+
observable_x_k05k12 condition inf 0.0540117162
118+
observable_x_k05k12 condition inf 0.0511675275
119+
observable_x_k05k12 condition inf 0.0440053677
120+
observable_x_k05k12 condition inf 0.0307945134
121+
observable_x_k05k12 condition inf 0.0388013075
122+
observable_x_k05k12k16 condition inf 0.0014459526
123+
observable_x_k05k12k16 condition inf 0.0028546517
124+
observable_x_k05k12k16 condition inf 0.0016474004
125+
observable_x_k05k12k16 condition inf 0.0015634113
126+
observable_x_k05k12k16 condition inf 0.0021988099
127+
observable_x_k05k12k16 condition inf 0.0025712943
128+
observable_x_k05k12k16 condition inf 0.0030239645
129+
observable_x_k05k12k16 condition inf 0.0051696682
130+
observable_x_k05k12k16 condition inf 0.0032202149
131+
observable_x_k05k12k16 condition inf 0.0039142288
132+
observable_x_k05k12k16 condition inf 0.0035694069
133+
observable_x_k05k12k16 condition inf 0.0020821695
134+
observable_x_k05k12k16 condition inf 0.0034115859
135+
observable_x_k05k12k16 condition inf 0.0020275485
136+
observable_x_k05k12k16 condition inf 0.0031633495
137+
observable_x_k05k12k16 condition inf 0.0017505789
138+
observable_x_k05k12k16 condition inf 0.0011259586
14139
observable_x_k05k12k16 condition inf 0.002221161
140+
observable_x_k08 condition inf 0.0285863714
141+
observable_x_k08 condition inf 0.0360768167
142+
observable_x_k08 condition inf 0.032107581
143+
observable_x_k08 condition inf 0.0299297615
144+
observable_x_k08 condition inf 0.0331305
145+
observable_x_k08 condition inf 0.0307525304
146+
observable_x_k08 condition inf 0.037988979
147+
observable_x_k08 condition inf 0.0333322401
148+
observable_x_k08 condition inf 0.0478313941
149+
observable_x_k08 condition inf 0.0342602774
150+
observable_x_k08 condition inf 0.0339720718
151+
observable_x_k08 condition inf 0.0267568853
152+
observable_x_k08 condition inf 0.0255184446
153+
observable_x_k08 condition inf 0.0302017929
154+
observable_x_k08 condition inf 0.0264043215
155+
observable_x_k08 condition inf 0.0308265468
156+
observable_x_k08 condition inf 0.0245199861
157+
observable_x_k08 condition inf 0.0306241172
158+
observable_x_k08k12 condition inf 0.0080967193
159+
observable_x_k08k12 condition inf 0.0065363759
160+
observable_x_k08k12 condition inf 0.0065426513
161+
observable_x_k08k12 condition inf 0.0133786749
162+
observable_x_k08k12 condition inf 0.0121658868
163+
observable_x_k08k12 condition inf 0.0079245333
164+
observable_x_k08k12 condition inf 0.0054277999
165+
observable_x_k08k12 condition inf 0.0053220896
166+
observable_x_k08k12 condition inf 0.0054696133
167+
observable_x_k08k12 condition inf 0.0101090455
168+
observable_x_k08k12 condition inf 0.0094183962
169+
observable_x_k08k12 condition inf 0.0060419851
170+
observable_x_k08k12k16 condition inf 0.0034915637
171+
observable_x_k08k12k16 condition inf 0.0021823912
172+
observable_x_k08k12k16 condition inf 0.0034256206
173+
observable_x_k08k12k16 condition inf 0.003396277
174+
observable_x_k08k12k16 condition inf 0.0032172172
175+
observable_x_k08k12k16 condition inf 0.0034887922
176+
observable_x_k08k12k16 condition inf 0.0043486252
177+
observable_x_k08k12k16 condition inf 0.0043888815
178+
observable_x_k08k12k16 condition inf 0.0053253436
179+
observable_x_k08k12k16 condition inf 0.0038018268
180+
observable_x_k08k12k16 condition inf 0.004321794
181+
observable_x_k08k12k16 condition inf 0.0041416352
182+
observable_x_k08k12k16 condition inf 0.0037099053
183+
observable_x_k08k12k16 condition inf 0.0027575143
184+
observable_x_k08k12k16 condition inf 0.0032139497
185+
observable_x_k08k12k16 condition inf 0.0039214407
186+
observable_x_k08k12k16 condition inf 0.0023350612
15187
observable_x_k08k12k16 condition inf 0.0014335656
16-
observable_x_4ac condition inf 0.0014080101
188+
observable_x_k08k16 condition inf 0.0038262075
189+
observable_x_k08k16 condition inf 0.0067116281
190+
observable_x_k08k16 condition inf 0.0055278515
191+
observable_x_k08k16 condition inf 0.0039600068
192+
observable_x_k08k16 condition inf 0.0013848019
193+
observable_x_k08k16 condition inf 0.0052229185
194+
observable_x_k08k16 condition inf 0.0066441942
195+
observable_x_k08k16 condition inf 0.0067009986
196+
observable_x_k08k16 condition inf 0.0076181629
197+
observable_x_k08k16 condition inf 0.0040375288
198+
observable_x_k08k16 condition inf 0.0012796644
199+
observable_x_k08k16 condition inf 0.0035808013
200+
observable_x_k12 condition inf 0.0698911177
201+
observable_x_k12 condition inf 0.0657316077
202+
observable_x_k12 condition inf 0.0706330493
203+
observable_x_k12 condition inf 0.0726269828
204+
observable_x_k12 condition inf 0.0719746032
205+
observable_x_k12 condition inf 0.0658753768
206+
observable_x_k12 condition inf 0.0821448646
207+
observable_x_k12 condition inf 0.0800844078
208+
observable_x_k12 condition inf 0.0760295558
209+
observable_x_k12 condition inf 0.0825408662
210+
observable_x_k12 condition inf 0.0893413419
211+
observable_x_k12 condition inf 0.0779044736
212+
observable_x_k12 condition inf 0.0750340555
213+
observable_x_k12 condition inf 0.0847380136
214+
observable_x_k12 condition inf 0.0712320521
215+
observable_x_k12 condition inf 0.074118084
216+
observable_x_k12 condition inf 0.0572650931
217+
observable_x_k12 condition inf 0.0623801676
218+
observable_x_k12k16 condition inf 0.0071480679
219+
observable_x_k12k16 condition inf 0.0067384313
220+
observable_x_k12k16 condition inf 0.0070938912
221+
observable_x_k12k16 condition inf 0.0070100966
222+
observable_x_k12k16 condition inf 0.0079196391
223+
observable_x_k12k16 condition inf 0.0082749836
224+
observable_x_k12k16 condition inf 0.0116770005
225+
observable_x_k12k16 condition inf 0.0083859816
226+
observable_x_k12k16 condition inf 0.0087131588
227+
observable_x_k12k16 condition inf 0.008795474
228+
observable_x_k12k16 condition inf 0.0100321792
229+
observable_x_k12k16 condition inf 0.0075142106
230+
observable_x_k12k16 condition inf 0.0085223315
231+
observable_x_k12k16 condition inf 0.0081841044
232+
observable_x_k12k16 condition inf 0.0080296142
233+
observable_x_k12k16 condition inf 0.00870624
234+
observable_x_k12k16 condition inf 0.0069110704
235+
observable_x_k12k16 condition inf 0.0061287628
236+
observable_x_k16 condition inf 0.0340003746
237+
observable_x_k16 condition inf 0.0369876278
238+
observable_x_k16 condition inf 0.033021657
239+
observable_x_k16 condition inf 0.0316938561
240+
observable_x_k16 condition inf 0.0333103419
241+
observable_x_k16 condition inf 0.0351303222
242+
observable_x_k16 condition inf 0.035258857
243+
observable_x_k16 condition inf 0.0374192315
244+
observable_x_k16 condition inf 0.0352520559
245+
observable_x_k16 condition inf 0.0368370926
246+
observable_x_k16 condition inf 0.0403769705
247+
observable_x_k16 condition inf 0.0308594544
248+
observable_x_k16 condition inf 0.0280646579
249+
observable_x_k16 condition inf 0.0301801107
250+
observable_x_k16 condition inf 0.0317391594
251+
observable_x_k16 condition inf 0.0306364098
252+
observable_x_k16 condition inf 0.0331148093
253+
observable_x_k16 condition inf 0.0341717472

0 commit comments

Comments
 (0)