Skip to content

Commit 1bf7e0f

Browse files
authored
Release 0.1.20
2 parents 99b2d21 + a44c01f commit 1bf7e0f

33 files changed

+833
-333
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
## 0.1 series
44

5+
### 0.1.20
6+
7+
* Visualization: plot additional simulation points (not only at measurements) (#62), bugfix (#68)
8+
* Documentation: visualization, observables, simulation, Sphinx fixes (#67)
9+
* Lint: ensure valid parameter IDs in observable and noise parameters (#69)
10+
* Convenience method for quick export of a PEtab problem to files (#71)
11+
512
### 0.1.19
613

714
* Visualization: refactoring (#58) including various bug fixes

doc/conf.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99
import sys
1010
import warnings
1111

12+
# Sphinx autosummary does not handle well submodules and functions with
13+
# identical names if the function is part of __all__ of the parent module.
14+
# This is way, we get autosummary to create the submodule documentation:
15+
import petab
16+
from petab.visualize.plot_data_and_simulation import plot_data_and_simulation
17+
petab.visualize.plot_data_and_simulation = \
18+
sys.modules['petab.visualize.plot_data_and_simulation']
19+
1220
# -- Path setup --------------------------------------------------------------
1321

1422
# If extensions (or modules to document with autodoc) are in another directory,

doc/example/example_Isensee/Isensee_visualizationSpecification.tsv

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ plot4 JI09_151102_Drg421_418_Age LinePlot MeanAndSD JI09_151102_Drg421_418_Age__
3030
plot5 JI09_160126_Drg449_444_CycNuc BarPlot MeanAndSD JI09_160126_Drg449_444_CycNuc__ctrl condition 0 Condition pRII_Western 0 pRII_Western Ctrl lin lin
3131
plot5 JI09_160126_Drg449_444_CycNuc BarPlot MeanAndSD JI09_160126_Drg449_444_CycNuc__Fsk10_and_IBMX100 condition 0 Condition pRII_Western 0 pRII_Western IBMX(100)/Fsk(10) lin lin
3232
plot5 JI09_160126_Drg449_444_CycNuc BarPlot MeanAndSD JI09_160126_Drg449_444_CycNuc__Sp8_Br_cAMPS_AM10 condition 0 Condition pRII_Western 0 pRII_Western Sp8-Br-cAMPS-AM(10) lin lin
33-
plot6 JI09_160201_Drg453-452_CycNuc LinePlot MeanAndSD JI09_160201_Drg453-452_CycNuc__ctrl time 0 Time [min] Calpha_Microscopy 0 Calpha_Microscopy Ctrl lin lin
34-
plot6 JI09_160201_Drg453-452_CycNuc LinePlot MeanAndSD JI09_160201_Drg453-452_CycNuc__Fsk time 0 Time [min] Calpha_Microscopy 0 Calpha_Microscopy Fsk(10) lin lin
35-
plot6 JI09_160201_Drg453-452_CycNuc LinePlot MeanAndSD JI09_160201_Drg453-452_CycNuc__Sp8_Br_cAMPS_AM time 0 Time [min] Calpha_Microscopy 0 Calpha_Microscopy Sp8-Br-cAMPS-AM(10) lin lin
33+
plot6 JI09_160201_Drg453-452_CycNuc ScatterPlot MeanAndSD JI09_160201_Drg453-452_CycNuc__ctrl time 0 Time [min] Calpha_Microscopy 0 Calpha_Microscopy Ctrl lin lin
34+
plot6 JI09_160201_Drg453-452_CycNuc ScatterPlot MeanAndSD JI09_160201_Drg453-452_CycNuc__Fsk time 0 Time [min] Calpha_Microscopy 0 Calpha_Microscopy Fsk(10) lin lin
35+
plot6 JI09_160201_Drg453-452_CycNuc ScatterPlot MeanAndSD JI09_160201_Drg453-452_CycNuc__Sp8_Br_cAMPS_AM time 0 Time [min] Calpha_Microscopy 0 Calpha_Microscopy Sp8-Br-cAMPS-AM(10) lin lin
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
plotId plotName plotTypeSimulation plotTypeData datasetId xValues xOffset yValues yOffset yLabel legendEntry xScale yScale
2+
plot1 JI09_150302_Drg345_343_CycNuc LinePlot MeanAndSD JI09_150302_Drg345_343_CycNuc__4_ABnOH_and_ctrl fourABnOH_incubation_time 0 pRII_Microscopy 0 pRII_Microscopy 4-ABnOH/Ctrl lin lin
3+
plot1 JI09_150302_Drg345_343_CycNuc LinePlot MeanAndSD JI09_150302_Drg345_343_CycNuc__4_ABnOH_and_Fsk fourABnOH_incubation_time 0 pRII_Microscopy 0 pRII_Microscopy 4-ABnOH/Fsk(10) lin lin
4+
plot1 JI09_150302_Drg345_343_CycNuc LinePlot MeanAndSD JI09_150302_Drg345_343_CycNuc__Rp_cAMPS_pAB_and_ctrl Rp_cAMPS_pAB_incubation_time 0 pRII_Microscopy 0 pRII_Microscopy Rp-cAMPS-pAB/Ctrl lin lin
5+
plot1 JI09_150302_Drg345_343_CycNuc LinePlot MeanAndSD JI09_150302_Drg345_343_CycNuc__Rp_cAMPS_pAB_and_ctrl Rp_cAMPS_pAB_incubation_time 0 pRII_Microscopy 0 pRII_Microscopy Rp-cAMPS-pAB/Fsk(10) lin lin
6+
plot2 JI09_150302_Drg345_343_CycNuc LinePlot replicate JI09_150302_Drg345_343_CycNuc__4_ABnOH_and_ctrl fourABnOH_incubation_time 0 pRII_Microscopy 0 pRII_Microscopy 4-ABnOH/Ctrl lin lin
7+
plot2 JI09_150302_Drg345_343_CycNuc LinePlot replicate JI09_150302_Drg345_343_CycNuc__4_ABnOH_and_Fsk fourABnOH_incubation_time 0 pRII_Microscopy 0 pRII_Microscopy 4-ABnOH/Fsk(10) lin lin
8+
plot2 JI09_150302_Drg345_343_CycNuc LinePlot replicate JI09_150302_Drg345_343_CycNuc__Rp_cAMPS_pAB_and_ctrl Rp_cAMPS_pAB_incubation_time 0 pRII_Microscopy 0 pRII_Microscopy Rp-cAMPS-pAB/Ctrl lin lin
9+
plot2 JI09_150302_Drg345_343_CycNuc LinePlot replicate JI09_150302_Drg345_343_CycNuc__Rp_cAMPS_pAB_and_ctrl Rp_cAMPS_pAB_incubation_time 0 pRII_Microscopy 0 pRII_Microscopy Rp-cAMPS-pAB/Fsk(10) lin lin
10+
plot3 JI09_160201_Drg453-452_CycNuc LinePlot MeanAndSD JI09_160201_Drg453-452_CycNuc__ctrl time 0 Calpha_Microscopy 0 Calpha_Microscopy Ctrl lin lin
11+
plot3 JI09_160201_Drg453-452_CycNuc LinePlot MeanAndSD JI09_160201_Drg453-452_CycNuc__Fsk time 0 Calpha_Microscopy 0 Calpha_Microscopy Fsk(10) lin lin
12+
plot3 JI09_160201_Drg453-452_CycNuc LinePlot MeanAndSD JI09_160201_Drg453-452_CycNuc__Sp8_Br_cAMPS_AM time 0 Calpha_Microscopy 0 Calpha_Microscopy Sp8-Br-cAMPS-AM(10) lin lin
13+
plot4 JI09_160201_Drg453-452_CycNuc LinePlot replicate JI09_160201_Drg453-452_CycNuc__ctrl time 0 Calpha_Microscopy 0 Calpha_Microscopy Ctrl lin lin
14+
plot4 JI09_160201_Drg453-452_CycNuc LinePlot replicate JI09_160201_Drg453-452_CycNuc__Fsk time 0 Calpha_Microscopy 0 Calpha_Microscopy Fsk(10) lin lin
15+
plot4 JI09_160201_Drg453-452_CycNuc LinePlot replicate JI09_160201_Drg453-452_CycNuc__Sp8_Br_cAMPS_AM time 0 Calpha_Microscopy 0 Calpha_Microscopy Sp8-Br-cAMPS-AM(10) lin lin

doc/modules.rst

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
API Reference
22
=============
33

4+
.. automodule:: petab
5+
6+
.. rubric:: Modules
7+
48
.. autosummary::
59
:toctree: build/_autosummary
10+
:recursive:
611

7-
petab
12+
petab.C
13+
petab.calculate
814
petab.composite_problem
9-
petab.core
1015
petab.conditions
11-
petab.C
16+
petab.core
1217
petab.lint
1318
petab.measurements
19+
petab.observables
1420
petab.parameter_mapping
1521
petab.parameters
1622
petab.problem
1723
petab.sampling
1824
petab.sbml
25+
petab.simulate
26+
petab.visualize
1927
petab.yaml
20-
petab.visualize.data_overview
21-
petab.visualize.helper_functions
22-
petab.visualize.plot_data_and_simulation
23-
petab.visualize.plotting_config

petab/C.py

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,168 +5,266 @@
55

66
# MEASUREMENTS
77

8+
#:
89
OBSERVABLE_ID = 'observableId'
10+
11+
#:
912
PREEQUILIBRATION_CONDITION_ID = 'preequilibrationConditionId'
13+
14+
#:
1015
SIMULATION_CONDITION_ID = 'simulationConditionId'
16+
17+
#:
1118
MEASUREMENT = 'measurement'
19+
20+
#:
1221
TIME = 'time'
22+
23+
#:
1324
OBSERVABLE_PARAMETERS = 'observableParameters'
25+
26+
#:
1427
NOISE_PARAMETERS = 'noiseParameters'
28+
29+
#:
1530
DATASET_ID = 'datasetId'
31+
32+
#:
1633
REPLICATE_ID = 'replicateId'
1734

35+
#: Mandatory columns of measurement table
1836
MEASUREMENT_DF_REQUIRED_COLS = [
1937
OBSERVABLE_ID, SIMULATION_CONDITION_ID, MEASUREMENT, TIME]
2038

39+
#: Optional columns of measurement table
2140
MEASUREMENT_DF_OPTIONAL_COLS = [
2241
PREEQUILIBRATION_CONDITION_ID, OBSERVABLE_PARAMETERS,
2342
NOISE_PARAMETERS,
2443
DATASET_ID, REPLICATE_ID]
2544

45+
#: Measurement table columns
2646
MEASUREMENT_DF_COLS = [
2747
MEASUREMENT_DF_REQUIRED_COLS[0], MEASUREMENT_DF_OPTIONAL_COLS[0],
2848
*MEASUREMENT_DF_REQUIRED_COLS[1:], *MEASUREMENT_DF_OPTIONAL_COLS[1:]]
2949

3050

3151
# PARAMETERS
3252

53+
#:
3354
PARAMETER_ID = 'parameterId'
55+
#:
3456
PARAMETER_NAME = 'parameterName'
57+
#:
3558
PARAMETER_SCALE = 'parameterScale'
59+
#:
3660
LOWER_BOUND = 'lowerBound'
61+
#:
3762
UPPER_BOUND = 'upperBound'
63+
#:
3864
NOMINAL_VALUE = 'nominalValue'
65+
#:
3966
ESTIMATE = 'estimate'
67+
#:
4068
INITIALIZATION_PRIOR_TYPE = 'initializationPriorType'
69+
#:
4170
INITIALIZATION_PRIOR_PARAMETERS = 'initializationPriorParameters'
71+
#:
4272
OBJECTIVE_PRIOR_TYPE = 'objectivePriorType'
73+
#:
4374
OBJECTIVE_PRIOR_PARAMETERS = 'objectivePriorParameters'
4475

76+
#: Mandatory columns of parameter table
4577
PARAMETER_DF_REQUIRED_COLS = [
4678
PARAMETER_ID, PARAMETER_SCALE, LOWER_BOUND, UPPER_BOUND, ESTIMATE]
4779

80+
#: Optional columns of parameter table
4881
PARAMETER_DF_OPTIONAL_COLS = [
4982
PARAMETER_NAME, NOMINAL_VALUE,
5083
INITIALIZATION_PRIOR_TYPE, INITIALIZATION_PRIOR_PARAMETERS,
5184
OBJECTIVE_PRIOR_TYPE, OBJECTIVE_PRIOR_PARAMETERS]
5285

86+
#: Parameter table columns
5387
PARAMETER_DF_COLS = [
5488
PARAMETER_DF_REQUIRED_COLS[0], PARAMETER_DF_OPTIONAL_COLS[0],
5589
*PARAMETER_DF_REQUIRED_COLS[1:], *PARAMETER_DF_OPTIONAL_COLS[1:]]
5690

91+
#:
5792
INITIALIZATION = 'initialization'
93+
#:
5894
OBJECTIVE = 'objective'
5995

6096

6197
# CONDITIONS
6298

99+
#:
63100
CONDITION_ID = 'conditionId'
101+
#:
64102
CONDITION_NAME = 'conditionName'
65103

66104

67105
# OBSERVABLES
68106

107+
#:
69108
OBSERVABLE_NAME = 'observableName'
109+
#:
70110
OBSERVABLE_FORMULA = 'observableFormula'
111+
#:
71112
NOISE_FORMULA = 'noiseFormula'
113+
#:
72114
OBSERVABLE_TRANSFORMATION = 'observableTransformation'
115+
#:
73116
NOISE_DISTRIBUTION = 'noiseDistribution'
74117

118+
#: Mandatory columns of observables table
75119
OBSERVABLE_DF_REQUIRED_COLS = [
76120
OBSERVABLE_ID, OBSERVABLE_FORMULA, NOISE_FORMULA]
77121

122+
#: Optional columns of observables table
78123
OBSERVABLE_DF_OPTIONAL_COLS = [
79124
OBSERVABLE_NAME, OBSERVABLE_TRANSFORMATION, NOISE_DISTRIBUTION]
80125

126+
#: Observables table columns
81127
OBSERVABLE_DF_COLS = [
82128
*OBSERVABLE_DF_REQUIRED_COLS, *OBSERVABLE_DF_OPTIONAL_COLS]
83129

84130

85131
# TRANSFORMATIONS
86132

133+
#:
87134
LIN = 'lin'
135+
#:
88136
LOG = 'log'
137+
#:
89138
LOG10 = 'log10'
139+
#: Supported observable transformations
90140
OBSERVABLE_TRANSFORMATIONS = [LIN, LOG, LOG10]
91141

92142

93143
# NOISE MODELS
94144

145+
#:
95146
UNIFORM = 'uniform'
147+
#:
96148
PARAMETER_SCALE_UNIFORM = 'parameterScaleUniform'
149+
#:
97150
NORMAL = 'normal'
151+
#:
98152
PARAMETER_SCALE_NORMAL = 'parameterScaleNormal'
153+
#:
99154
LAPLACE = 'laplace'
155+
#:
100156
PARAMETER_SCALE_LAPLACE = 'parameterScaleLaplace'
157+
#:
101158
LOG_NORMAL = 'logNormal'
159+
#:
102160
LOG_LAPLACE = 'logLaplace'
103161

162+
#: Supported prior types
104163
PRIOR_TYPES = [
105164
UNIFORM, NORMAL, LAPLACE, LOG_NORMAL, LOG_LAPLACE,
106165
PARAMETER_SCALE_UNIFORM, PARAMETER_SCALE_NORMAL, PARAMETER_SCALE_LAPLACE]
107166

167+
#: Supported noise distributions
108168
NOISE_MODELS = [NORMAL, LAPLACE]
109169

110170

111171
# VISUALIZATION
112172

173+
#:
113174
PLOT_ID = 'plotId'
175+
#:
114176
PLOT_NAME = 'plotName'
177+
#:
115178
PLOT_TYPE_SIMULATION = 'plotTypeSimulation'
179+
#:
116180
PLOT_TYPE_DATA = 'plotTypeData'
181+
#:
117182
X_VALUES = 'xValues'
183+
#:
118184
X_OFFSET = 'xOffset'
185+
#:
119186
X_LABEL = 'xLabel'
187+
#:
120188
X_SCALE = 'xScale'
189+
#:
121190
Y_VALUES = 'yValues'
191+
#:
122192
Y_OFFSET = 'yOffset'
193+
#:
123194
Y_LABEL = 'yLabel'
195+
#:
124196
Y_SCALE = 'yScale'
197+
#:
125198
LEGEND_ENTRY = 'legendEntry'
126199

200+
#: Mandatory columns of visualization table
127201
VISUALIZATION_DF_REQUIRED_COLS = [PLOT_ID]
128202

203+
#: Optional columns of visualization table
129204
VISUALIZATION_DF_OPTIONAL_COLS = [
130205
PLOT_NAME, PLOT_TYPE_SIMULATION, PLOT_TYPE_DATA, X_VALUES, X_OFFSET,
131206
X_LABEL, X_SCALE, Y_VALUES, Y_OFFSET, Y_LABEL, Y_SCALE, LEGEND_ENTRY,
132207
DATASET_ID]
133208

209+
#: Visualization table columns
134210
VISUALIZATION_DF_COLS = [
135211
*VISUALIZATION_DF_REQUIRED_COLS, *VISUALIZATION_DF_OPTIONAL_COLS]
136212

213+
#: Visualization table columns that contain subplot specifications
137214
VISUALIZATION_DF_SUBPLOT_LEVEL_COLS = [
138215
PLOT_ID, PLOT_NAME, PLOT_TYPE_SIMULATION, PLOT_TYPE_DATA,
139216
X_LABEL, X_SCALE, Y_LABEL, Y_SCALE]
140217

218+
#: Visualization table columns that contain single plot specifications
141219
VISUALIZATION_DF_SINGLE_PLOT_LEVEL_COLS = [
142220
X_VALUES, X_OFFSET, Y_VALUES, Y_OFFSET, LEGEND_ENTRY, DATASET_ID]
143221

222+
#:
144223
LINE_PLOT = 'LinePlot'
224+
#:
145225
BAR_PLOT = 'BarPlot'
226+
#:
146227
SCATTER_PLOT = 'ScatterPlot'
228+
#: Supported plot types
147229
PLOT_TYPES_SIMULATION = [LINE_PLOT, BAR_PLOT, SCATTER_PLOT]
148230

149231

232+
#:
150233
MEAN_AND_SD = 'MeanAndSD'
234+
#:
151235
MEAN_AND_SEM = 'MeanAndSEM'
236+
#:
152237
REPLICATE = 'replicate'
238+
#:
153239
PROVIDED = 'provided'
240+
#: Supported settings for handling replicates
154241
PLOT_TYPES_DATA = [MEAN_AND_SD, MEAN_AND_SEM, REPLICATE, PROVIDED]
155242

156243

157244
# YAML
245+
#:
158246
FORMAT_VERSION = 'format_version'
247+
#:
159248
PARAMETER_FILE = 'parameter_file'
249+
#:
160250
PROBLEMS = 'problems'
251+
#:
161252
SBML_FILES = 'sbml_files'
253+
#:
162254
CONDITION_FILES = 'condition_files'
255+
#:
163256
MEASUREMENT_FILES = 'measurement_files'
257+
#:
164258
OBSERVABLE_FILES = 'observable_files'
259+
#:
165260
VISUALIZATION_FILES = 'visualization_files'
166261

167262

168263
# MORE
169264

265+
#:
170266
SIMULATION = 'simulation'
267+
#:
171268
RESIDUAL = 'residual'
269+
#:
172270
NOISE_VALUE = 'noiseValue'

petab/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
"""PEtab global
1+
"""
2+
PEtab global
3+
============
24
35
Attributes:
46
ENV_NUM_THREADS:
@@ -9,6 +11,7 @@
911

1012
ENV_NUM_THREADS = "PETAB_NUM_THREADS"
1113

14+
from .C import * # noqa: F403, F401, E402
1215
from .calculate import * # noqa: F403, F401, E402
1316
from .composite_problem import * # noqa: F403, F401, E402
1417
from .conditions import * # noqa: F403, F401, E402

0 commit comments

Comments
 (0)