forked from PEtab-dev/libpetab-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathC.py
More file actions
289 lines (236 loc) · 6.86 KB
/
C.py
File metadata and controls
289 lines (236 loc) · 6.86 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
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
# pylint: disable:invalid-name
"""
This file contains constant definitions.
"""
import math as _math
import sys
# MEASUREMENTS
#: Observable ID column in the observable and measurement tables
OBSERVABLE_ID = "observableId"
#: Experiment ID column in the measurement table
EXPERIMENT_ID = "experimentId"
#: Measurement value column in the measurement table
MEASUREMENT = "measurement"
#: Time column in the measurement table
TIME = "time"
#: Time value that indicates steady-state measurements
TIME_STEADY_STATE = _math.inf
#: Time value that indicates pre-equilibration in the experiments table
TIME_PREEQUILIBRATION = -_math.inf
#: Observable parameters column in the measurement table
OBSERVABLE_PARAMETERS = "observableParameters"
#: Noise parameters column in the measurement table
NOISE_PARAMETERS = "noiseParameters"
#: Dataset ID column in the measurement table
DATASET_ID = "datasetId"
#: Replicate ID column in the measurement table
REPLICATE_ID = "replicateId"
#: Mandatory columns of measurement table
MEASUREMENT_DF_REQUIRED_COLS = [
OBSERVABLE_ID,
EXPERIMENT_ID,
MEASUREMENT,
TIME,
]
#: Optional columns of measurement table
MEASUREMENT_DF_OPTIONAL_COLS = [
OBSERVABLE_PARAMETERS,
NOISE_PARAMETERS,
DATASET_ID,
REPLICATE_ID,
]
#: Measurement table columns
MEASUREMENT_DF_COLS = [
MEASUREMENT_DF_REQUIRED_COLS[0],
MEASUREMENT_DF_OPTIONAL_COLS[0],
*MEASUREMENT_DF_REQUIRED_COLS[1:],
*MEASUREMENT_DF_OPTIONAL_COLS[1:],
]
# PARAMETERS
#: Parameter ID column in the parameter table
PARAMETER_ID = "parameterId"
#: Parameter name column in the parameter table
PARAMETER_NAME = "parameterName"
#: Lower bound column in the parameter table
LOWER_BOUND = "lowerBound"
#: Upper bound column in the parameter table
UPPER_BOUND = "upperBound"
#: Nominal value column in the parameter table
NOMINAL_VALUE = "nominalValue"
#: Estimate column in the parameter table
ESTIMATE = "estimate"
#: Prior distribution type column in the parameter table
PRIOR_DISTRIBUTION = "priorDistribution"
#: Prior parameters column in the parameter table
PRIOR_PARAMETERS = "priorParameters"
#: Mandatory columns of parameter table
PARAMETER_DF_REQUIRED_COLS = [
PARAMETER_ID,
LOWER_BOUND,
UPPER_BOUND,
ESTIMATE,
]
#: Optional columns of parameter table
PARAMETER_DF_OPTIONAL_COLS = [
PARAMETER_NAME,
NOMINAL_VALUE,
PRIOR_DISTRIBUTION,
PRIOR_PARAMETERS,
]
#: Parameter table columns
PARAMETER_DF_COLS = [
PARAMETER_DF_REQUIRED_COLS[0],
PARAMETER_DF_OPTIONAL_COLS[0],
*PARAMETER_DF_REQUIRED_COLS[1:],
*PARAMETER_DF_OPTIONAL_COLS[1:],
]
#: Initialization-type prior
INITIALIZATION = "initialization"
#: Objective-type prior
OBJECTIVE = "objective"
# CONDITIONS
#: Condition ID column in the condition table
CONDITION_ID = "conditionId"
#: Column in the condition table with the ID of an entity that is changed
TARGET_ID = "targetId"
#: Column in the condition table with the new value of the target entity
TARGET_VALUE = "targetValue"
CONDITION_DF_COLS = [
CONDITION_ID,
TARGET_ID,
TARGET_VALUE,
]
CONDITION_DF_REQUIRED_COLS = CONDITION_DF_COLS
# EXPERIMENTS
EXPERIMENT_DF_REQUIRED_COLS = [
EXPERIMENT_ID,
TIME,
CONDITION_ID,
]
# OBSERVABLES
#: Observable name column in the observable table
OBSERVABLE_NAME = "observableName"
#: Observable formula column in the observable table
OBSERVABLE_FORMULA = "observableFormula"
#: Observable placeholders column in the observable table
OBSERVABLE_PLACEHOLDERS = "observablePlaceholders"
#: Noise formula column in the observable table
NOISE_FORMULA = "noiseFormula"
#: Noise distribution column in the observable table
NOISE_DISTRIBUTION = "noiseDistribution"
#: Noise placeholders column in the observable table
NOISE_PLACEHOLDERS = "noisePlaceholders"
#: Mandatory columns of observable table
OBSERVABLE_DF_REQUIRED_COLS = [
OBSERVABLE_ID,
OBSERVABLE_FORMULA,
NOISE_FORMULA,
]
#: Optional columns of observable table
OBSERVABLE_DF_OPTIONAL_COLS = [
OBSERVABLE_NAME,
NOISE_DISTRIBUTION,
]
#: Observables table columns
OBSERVABLE_DF_COLS = [
*OBSERVABLE_DF_REQUIRED_COLS,
*OBSERVABLE_DF_OPTIONAL_COLS,
]
# TRANSFORMATIONS
#: Linear transformation
LIN = "lin"
#: Logarithmic transformation
LOG = "log"
#: Logarithmic base 10 transformation
LOG10 = "log10"
# NOISE MODELS
#: Cauchy distribution.
CAUCHY = "cauchy"
#: Chi-squared distribution.
# FIXME: "chisquare" in PEtab and sbml-distrib, but usually "chi-squared"
CHI_SQUARED = "chisquare"
#: Exponential distribution.
EXPONENTIAL = "exponential"
#: Gamma distribution.
GAMMA = "gamma"
#: Laplace distribution
LAPLACE = "laplace"
#: Log10-normal distribution.
LOG10_NORMAL = "log10-normal"
#: Log-Laplace distribution
LOG_LAPLACE = "log-laplace"
#: Log-normal distribution
LOG_NORMAL = "log-normal"
#: Log-uniform distribution.
LOG_UNIFORM = "log-uniform"
#: Normal distribution
NORMAL = "normal"
#: Rayleigh distribution.
RAYLEIGH = "rayleigh"
#: Uniform distribution
UNIFORM = "uniform"
#: Supported prior distribution types
PRIOR_DISTRIBUTIONS = [
CAUCHY,
CHI_SQUARED,
EXPONENTIAL,
GAMMA,
LAPLACE,
LOG10_NORMAL,
LOG_LAPLACE,
LOG_NORMAL,
LOG_UNIFORM,
NORMAL,
RAYLEIGH,
UNIFORM,
]
#: Supported noise distributions
NOISE_DISTRIBUTIONS = [NORMAL, LAPLACE, LOG_NORMAL, LOG_LAPLACE]
# YAML
#: PEtab version key in the YAML file
FORMAT_VERSION = "format_version"
#: Parameter files key in the YAML file
PARAMETER_FILES = "parameter_files"
#: Problems key in the YAML file
PROBLEMS = "problems"
#: Model files key in the YAML file
MODEL_FILES = "model_files"
#: Model location key in the YAML file
MODEL_LOCATION = "location"
#: Model language key in the YAML file
MODEL_LANGUAGE = "language"
#: Condition files key in the YAML file
CONDITION_FILES = "condition_files"
#: Experiment files key in the YAML file
EXPERIMENT_FILES = "experiment_files"
#: Measurement files key in the YAML file
MEASUREMENT_FILES = "measurement_files"
#: Observable files key in the YAML file
OBSERVABLE_FILES = "observable_files"
#: Visualization files key in the YAML file
VISUALIZATION_FILES = "visualization_files"
#: Mapping files key in the YAML file
MAPPING_FILES = "mapping_files"
#: Extensions key in the YAML file
EXTENSIONS = "extensions"
# MAPPING
#: PEtab entity ID column in the mapping table
PETAB_ENTITY_ID = "petabEntityId"
#: Model entity ID column in the mapping table
MODEL_ENTITY_ID = "modelEntityId"
#: Arbitrary name
NAME = "name"
#: Required columns of the mapping table
MAPPING_DF_REQUIRED_COLS = [PETAB_ENTITY_ID, MODEL_ENTITY_ID]
# MORE
#: Simulated value column in the simulation table
SIMULATION = "simulation"
#: Residual value column in the residual table
RESIDUAL = "residual"
#: separator for multiple parameter values (bounds, observableParameters, ...)
PARAMETER_SEPARATOR = ";"
__all__ = [
x
for x in dir(sys.modules[__name__])
if not x.startswith("_") and x not in {"sys", "math"}
]